diff mbox series

[v2,05/15] RDMA/srp: Propagate ib_post_send() failures to the SCSI mid-layer

Message ID 20181217212046.71017-6-bvanassche@acm.org (mailing list archive)
State Accepted
Commit 2ee00f6a98c36f7e4ba07cc33f24cc5a69060cc9
Delegated to: Doug Ledford
Headers show
Series Add support for immediate data to the SRP drivers | expand

Commit Message

Bart Van Assche Dec. 17, 2018, 9:20 p.m. UTC
This patch avoids that the SCSI mid-layer keeps retrying forever if
ib_post_send() fails. This was discovered while testing immediate
data support and passing a too large num_sge value to ib_post_send().

Cc: Sergey Gorenko <sergeygo@mellanox.com>
Cc: Max Gurtovoy <maxg@mellanox.com>
Cc: Laurence Oberman <loberman@redhat.com>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
---
 drivers/infiniband/ulp/srp/ib_srp.c | 1 +
 1 file changed, 1 insertion(+)
diff mbox series

Patch

diff --git a/drivers/infiniband/ulp/srp/ib_srp.c b/drivers/infiniband/ulp/srp/ib_srp.c
index 3ad7a1821022..06fcbd181bbf 100644
--- a/drivers/infiniband/ulp/srp/ib_srp.c
+++ b/drivers/infiniband/ulp/srp/ib_srp.c
@@ -2358,6 +2358,7 @@  static int srp_queuecommand(struct Scsi_Host *shost, struct scsi_cmnd *scmnd)
 
 	if (srp_post_send(ch, iu, len)) {
 		shost_printk(KERN_ERR, target->scsi_host, PFX "Send failed\n");
+		scmnd->result = DID_ERROR << 16;
 		goto err_unmap;
 	}