All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v1] Target/iser: Fail SCSI WRITE command if device detected integrity error
@ 2014-03-18 12:52 Sagi Grimberg
  2014-03-18 12:55 ` Or Gerlitz
  0 siblings, 1 reply; 2+ messages in thread
From: Sagi Grimberg @ 2014-03-18 12:52 UTC (permalink / raw)
  To: nab; +Cc: target-devel, ogerlitz, oren, linux-scsi

If during data-transfer a data-integrity error was detected we
must fail the command with CHECK_CONDITION and not execute
the command.

Cnages from v0:
- Added reported-by Or gerlitz

Signed-off-by: Sagi Grimberg <sagig@mellanox.com>
Reported-by: Or Gerlitz <ogerlitz@mellanox.com>
---
 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 e2d48a9..09bde9f 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,
 	struct se_cmd *se_cmd = &cmd->se_cmd;
 	struct isert_conn *isert_conn = isert_cmd->conn;
 	struct isert_device *device = isert_conn->conn_device;
-	int ret;
+	int ret = 0;
 
 	if (wr->fr_desc && wr->fr_desc->ind & ISERT_PROTECTED) {
 		ret = isert_check_pi_status(se_cmd,
@@ -1755,7 +1755,11 @@ isert_completion_rdma_read(struct iser_tx_desc *tx_desc,
 	cmd->i_state = ISTATE_RECEIVED_LAST_DATAOUT;
 	spin_unlock_bh(&cmd->istate_lock);
 
-	target_execute_cmd(se_cmd);
+	if (ret)
+		transport_send_check_condition_and_sense(se_cmd,
+							 se_cmd->pi_err, 0);
+	else
+		target_execute_cmd(se_cmd);
 }
 
 static void
-- 
1.7.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH v1] Target/iser: Fail SCSI WRITE command if device detected integrity error
  2014-03-18 12:52 [PATCH v1] Target/iser: Fail SCSI WRITE command if device detected integrity error Sagi Grimberg
@ 2014-03-18 12:55 ` Or Gerlitz
  0 siblings, 0 replies; 2+ messages in thread
From: Or Gerlitz @ 2014-03-18 12:55 UTC (permalink / raw)
  To: Sagi Grimberg, nab; +Cc: target-devel, oren, linux-scsi

On 18/03/2014 14:52, Sagi Grimberg wrote:
> If during data-transfer a data-integrity error was detected we
> must fail the command with CHECK_CONDITION and not execute
> the command.
>
> Cnages from v0:
> - Added reported-by Or gerlitz
>
> Signed-off-by: Sagi Grimberg<sagig@mellanox.com>
> Reported-by: Or Gerlitz<ogerlitz@mellanox.com>
> ---

s/Cnages/Changes

and put the history below  the --- line, it need not go into the 
upstream change-log

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-03-18 12:56 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-03-18 12:52 [PATCH v1] Target/iser: Fail SCSI WRITE command if device detected integrity error Sagi Grimberg
2014-03-18 12:55 ` Or Gerlitz

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.