aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/target
diff options
context:
space:
mode:
authorNicholas Bellinger <nab@linux-iscsi.org>2011-10-28 16:37:19 -0400
committerNicholas Bellinger <nab@linux-iscsi.org>2011-11-02 11:57:13 -0400
commit5a4c8666c6d576f076a7c6824589cdbb984c0f84 (patch)
treecd4eb1d2c67ff7cf99b4de4e9420c6c1df5b1085 /drivers/target
parent7e32da55e26b80d57961681e53aa67938268db3f (diff)
iscsi-target: Fix non-immediate TMR handling
This patch addresses two issues with non immediate TMR handling in iscsit_handle_task_mgt_cmd(). The first involves breakage due to v3.1-rc conversion of iscsit_sequence_cmd(), which upon good status would hit the iscsit_add_reject_from_cmd() block of code. This patch adds an explict check for CMDSN_ERROR_CANNOT_RECOVER. The second adds a check to return when non immediate TMR operation is detected after iscsit_ack_from_expstatsn(), as iscsit_sequence_cmd() -> iscsit_execute_cmd() will have called transport_generic_handle_tmr() for the non immediate TMR case already. Cc: Andy Grover <agrover@redhat.com> Cc: stable@kernel.org Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
Diffstat (limited to 'drivers/target')
-rw-r--r--drivers/target/iscsi/iscsi_target.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/drivers/target/iscsi/iscsi_target.c b/drivers/target/iscsi/iscsi_target.c
index 7855a63d49fc..1bf057ed9931 100644
--- a/drivers/target/iscsi/iscsi_target.c
+++ b/drivers/target/iscsi/iscsi_target.c
@@ -1821,17 +1821,16 @@ attach:
1821 int cmdsn_ret = iscsit_sequence_cmd(conn, cmd, hdr->cmdsn); 1821 int cmdsn_ret = iscsit_sequence_cmd(conn, cmd, hdr->cmdsn);
1822 if (cmdsn_ret == CMDSN_HIGHER_THAN_EXP) 1822 if (cmdsn_ret == CMDSN_HIGHER_THAN_EXP)
1823 out_of_order_cmdsn = 1; 1823 out_of_order_cmdsn = 1;
1824 else if (cmdsn_ret == CMDSN_LOWER_THAN_EXP) { 1824 else if (cmdsn_ret == CMDSN_LOWER_THAN_EXP)
1825 return 0; 1825 return 0;
1826 } else { /* (cmdsn_ret == CMDSN_ERROR_CANNOT_RECOVER) */ 1826 else if (cmdsn_ret == CMDSN_ERROR_CANNOT_RECOVER)
1827 return iscsit_add_reject_from_cmd( 1827 return iscsit_add_reject_from_cmd(
1828 ISCSI_REASON_PROTOCOL_ERROR, 1828 ISCSI_REASON_PROTOCOL_ERROR,
1829 1, 0, buf, cmd); 1829 1, 0, buf, cmd);
1830 }
1831 } 1830 }
1832 iscsit_ack_from_expstatsn(conn, hdr->exp_statsn); 1831 iscsit_ack_from_expstatsn(conn, hdr->exp_statsn);
1833 1832
1834 if (out_of_order_cmdsn) 1833 if (out_of_order_cmdsn || !(hdr->opcode & ISCSI_OP_IMMEDIATE))
1835 return 0; 1834 return 0;
1836 /* 1835 /*
1837 * Found the referenced task, send to transport for processing. 1836 * Found the referenced task, send to transport for processing.