iscsi-target: Add MaxXmitDataSegmentLength connection recovery check
[linux-2.6-microblaze.git] / drivers / target / iscsi / iscsi_target_tmr.c
index f62fe12..05d2e64 100644 (file)
@@ -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) {