diff --git a/drivers/target/iscsi/iscsi_target_core.h b/drivers/target/iscsi/iscsi_target_core.h index b26611aa5ff312175974baf5c3edbf420a5b0c8f..e6a830545c89e3fe5c07b67fd6360a2b6bb178a3 100644 --- a/drivers/target/iscsi/iscsi_target_core.h +++ b/drivers/target/iscsi/iscsi_target_core.h @@ -579,6 +579,7 @@ struct iscsi_conn_recovery { u16 cid; u32 cmd_count; u32 maxrecvdatasegmentlength; + u32 maxxmitdatasegmentlength; int ready_for_reallegiance; struct list_head conn_recovery_cmd_list; spinlock_t conn_recovery_cmd_lock; diff --git a/drivers/target/iscsi/iscsi_target_erl2.c b/drivers/target/iscsi/iscsi_target_erl2.c index 65aac14fd8312d12bd57bdc8ad9b59bff8a9a452..667c19cc3b284df7db076f6002a5ab96ec5ae6d2 100644 --- a/drivers/target/iscsi/iscsi_target_erl2.c +++ b/drivers/target/iscsi/iscsi_target_erl2.c @@ -421,6 +421,7 @@ int iscsit_prepare_cmds_for_realligance(struct iscsi_conn *conn) cr->cid = conn->cid; cr->cmd_count = cmd_count; cr->maxrecvdatasegmentlength = conn->conn_ops->MaxRecvDataSegmentLength; + cr->maxxmitdatasegmentlength = conn->conn_ops->MaxXmitDataSegmentLength; cr->sess = conn->sess; iscsit_attach_inactive_connection_recovery_entry(conn->sess, cr); diff --git a/drivers/target/iscsi/iscsi_target_tmr.c b/drivers/target/iscsi/iscsi_target_tmr.c index f62fe123d902cd78f0bdbee14337564559ec8ec9..05d2e6445ade7c24a258ef15e6304cad230448ab 100644 --- a/drivers/target/iscsi/iscsi_target_tmr.c +++ b/drivers/target/iscsi/iscsi_target_tmr.c @@ -146,7 +146,7 @@ u8 iscsit_tmr_task_reassign( } /* * Temporary check to prevent connection recovery for - * connections with a differing MaxRecvDataSegmentLength. + * connections with a differing Max*DataSegmentLength. */ if (cr->maxrecvdatasegmentlength != conn->conn_ops->MaxRecvDataSegmentLength) { @@ -155,6 +155,13 @@ u8 iscsit_tmr_task_reassign( " TMR TASK_REASSIGN.\n"); return ISCSI_TMF_RSP_REJECTED; } + if (cr->maxxmitdatasegmentlength != + conn->conn_ops->MaxXmitDataSegmentLength) { + pr_err("Unable to perform connection recovery for" + " differing MaxXmitDataSegmentLength, rejecting" + " TMR TASK_REASSIGN.\n"); + return ISCSI_TMF_RSP_REJECTED; + } ref_lun = scsilun_to_int(&hdr->lun); if (ref_lun != ref_cmd->se_cmd.orig_fe_lun) {