diff options
author | Sagi Grimberg <sagig@mellanox.com> | 2014-03-18 08:58:27 -0400 |
---|---|---|
committer | Nicholas Bellinger <nab@linux-iscsi.org> | 2014-04-07 04:48:49 -0400 |
commit | 5bac4b1a1fd84769df941eefb8bdbe010df6b876 (patch) | |
tree | 57e87527cd77eed08ccdfb255a0e3bcf5666f0fb /drivers/infiniband | |
parent | 96b7973e1c59e9ddde27bca882411c3980125330 (diff) |
Target/iser: Fail SCSI WRITE command if device detected integrity error
If during data-transfer a data-integrity error was detected we
must fail the command with CHECK_CONDITION and not execute
the command.
Signed-off-by: Sagi Grimberg <sagig@mellanox.com>
Reported-by: Or Gerlitz <ogerlitz@mellanox.com>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
Diffstat (limited to 'drivers/infiniband')
-rw-r--r-- | drivers/infiniband/ulp/isert/ib_isert.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/infiniband/ulp/isert/ib_isert.c b/drivers/infiniband/ulp/isert/ib_isert.c index e2d48a9d828a..09bde9fe6b8d 100644 --- a/drivers/infiniband/ulp/isert/ib_isert.c +++ b/drivers/infiniband/ulp/isert/ib_isert.c | |||
@@ -1736,7 +1736,7 @@ isert_completion_rdma_read(struct iser_tx_desc *tx_desc, | |||
1736 | struct se_cmd *se_cmd = &cmd->se_cmd; | 1736 | struct se_cmd *se_cmd = &cmd->se_cmd; |
1737 | struct isert_conn *isert_conn = isert_cmd->conn; | 1737 | struct isert_conn *isert_conn = isert_cmd->conn; |
1738 | struct isert_device *device = isert_conn->conn_device; | 1738 | struct isert_device *device = isert_conn->conn_device; |
1739 | int ret; | 1739 | int ret = 0; |
1740 | 1740 | ||
1741 | if (wr->fr_desc && wr->fr_desc->ind & ISERT_PROTECTED) { | 1741 | if (wr->fr_desc && wr->fr_desc->ind & ISERT_PROTECTED) { |
1742 | ret = isert_check_pi_status(se_cmd, | 1742 | ret = isert_check_pi_status(se_cmd, |
@@ -1755,7 +1755,11 @@ isert_completion_rdma_read(struct iser_tx_desc *tx_desc, | |||
1755 | cmd->i_state = ISTATE_RECEIVED_LAST_DATAOUT; | 1755 | cmd->i_state = ISTATE_RECEIVED_LAST_DATAOUT; |
1756 | spin_unlock_bh(&cmd->istate_lock); | 1756 | spin_unlock_bh(&cmd->istate_lock); |
1757 | 1757 | ||
1758 | target_execute_cmd(se_cmd); | 1758 | if (ret) |
1759 | transport_send_check_condition_and_sense(se_cmd, | ||
1760 | se_cmd->pi_err, 0); | ||
1761 | else | ||
1762 | target_execute_cmd(se_cmd); | ||
1759 | } | 1763 | } |
1760 | 1764 | ||
1761 | static void | 1765 | static void |