diff options
author | Nicholas Bellinger <nab@linux-iscsi.org> | 2012-09-30 01:14:51 -0400 |
---|---|---|
committer | Nicholas Bellinger <nab@linux-iscsi.org> | 2012-10-02 16:17:32 -0400 |
commit | 1c417f39c1f896206f0d5bfec65cd61a8f5e69b8 (patch) | |
tree | 94860180b473678b9621545406ae3c9c36575a3e /drivers/target | |
parent | 21f5aa7eb8572b5cfe36884c23d306c72fe3987c (diff) |
iscsi-target: Add MaxXmitDataSegmentLength connection recovery check
The iSCSI TMR TASK_REASSIGN completion logic in iscsi_tmr_task_reassign()
does an explict check for MRDSL across task reassignment, so go ahead and
add an explict MaxXmitDataSegmentLength check here as well to be safe.
Cc: Mike Christie <michaelc@cs.wisc.edu>
Cc: Andy Grover <agrover@redhat.com>
Cc: Hannes Reinecke <hare@suse.de>
Cc: Roland Dreier <roland@purestorage.com>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
Diffstat (limited to 'drivers/target')
-rw-r--r-- | drivers/target/iscsi/iscsi_target_core.h | 1 | ||||
-rw-r--r-- | drivers/target/iscsi/iscsi_target_erl2.c | 1 | ||||
-rw-r--r-- | drivers/target/iscsi/iscsi_target_tmr.c | 9 |
3 files changed, 10 insertions, 1 deletions
diff --git a/drivers/target/iscsi/iscsi_target_core.h b/drivers/target/iscsi/iscsi_target_core.h index b26611aa5ff3..e6a830545c89 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 { | |||
579 | u16 cid; | 579 | u16 cid; |
580 | u32 cmd_count; | 580 | u32 cmd_count; |
581 | u32 maxrecvdatasegmentlength; | 581 | u32 maxrecvdatasegmentlength; |
582 | u32 maxxmitdatasegmentlength; | ||
582 | int ready_for_reallegiance; | 583 | int ready_for_reallegiance; |
583 | struct list_head conn_recovery_cmd_list; | 584 | struct list_head conn_recovery_cmd_list; |
584 | spinlock_t conn_recovery_cmd_lock; | 585 | 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 65aac14fd831..667c19cc3b28 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) | |||
421 | cr->cid = conn->cid; | 421 | cr->cid = conn->cid; |
422 | cr->cmd_count = cmd_count; | 422 | cr->cmd_count = cmd_count; |
423 | cr->maxrecvdatasegmentlength = conn->conn_ops->MaxRecvDataSegmentLength; | 423 | cr->maxrecvdatasegmentlength = conn->conn_ops->MaxRecvDataSegmentLength; |
424 | cr->maxxmitdatasegmentlength = conn->conn_ops->MaxXmitDataSegmentLength; | ||
424 | cr->sess = conn->sess; | 425 | cr->sess = conn->sess; |
425 | 426 | ||
426 | iscsit_attach_inactive_connection_recovery_entry(conn->sess, cr); | 427 | 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 f62fe123d902..05d2e6445ade 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( | |||
146 | } | 146 | } |
147 | /* | 147 | /* |
148 | * Temporary check to prevent connection recovery for | 148 | * Temporary check to prevent connection recovery for |
149 | * connections with a differing MaxRecvDataSegmentLength. | 149 | * connections with a differing Max*DataSegmentLength. |
150 | */ | 150 | */ |
151 | if (cr->maxrecvdatasegmentlength != | 151 | if (cr->maxrecvdatasegmentlength != |
152 | conn->conn_ops->MaxRecvDataSegmentLength) { | 152 | conn->conn_ops->MaxRecvDataSegmentLength) { |
@@ -155,6 +155,13 @@ u8 iscsit_tmr_task_reassign( | |||
155 | " TMR TASK_REASSIGN.\n"); | 155 | " TMR TASK_REASSIGN.\n"); |
156 | return ISCSI_TMF_RSP_REJECTED; | 156 | return ISCSI_TMF_RSP_REJECTED; |
157 | } | 157 | } |
158 | if (cr->maxxmitdatasegmentlength != | ||
159 | conn->conn_ops->MaxXmitDataSegmentLength) { | ||
160 | pr_err("Unable to perform connection recovery for" | ||
161 | " differing MaxXmitDataSegmentLength, rejecting" | ||
162 | " TMR TASK_REASSIGN.\n"); | ||
163 | return ISCSI_TMF_RSP_REJECTED; | ||
164 | } | ||
158 | 165 | ||
159 | ref_lun = scsilun_to_int(&hdr->lun); | 166 | ref_lun = scsilun_to_int(&hdr->lun); |
160 | if (ref_lun != ref_cmd->se_cmd.orig_fe_lun) { | 167 | if (ref_lun != ref_cmd->se_cmd.orig_fe_lun) { |