summaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/ulp
diff options
context:
space:
mode:
authorBart Van Assche <bvanassche@acm.org>2018-12-17 22:20:36 +0100
committerDoug Ledford <dledford@redhat.com>2018-12-19 21:07:25 +0100
commit2ee00f6a98c36f7e4ba07cc33f24cc5a69060cc9 (patch)
treea460ea511318a1c0e78077e4eb4b802fbfd1583b /drivers/infiniband/ulp
parentRDMA/srp: Handle large SCSI CDBs correctly (diff)
downloadlinux-2ee00f6a98c36f7e4ba07cc33f24cc5a69060cc9.tar.xz
linux-2ee00f6a98c36f7e4ba07cc33f24cc5a69060cc9.zip
RDMA/srp: Propagate ib_post_send() failures to the SCSI mid-layer
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> Signed-off-by: Doug Ledford <dledford@redhat.com>
Diffstat (limited to 'drivers/infiniband/ulp')
-rw-r--r--drivers/infiniband/ulp/srp/ib_srp.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/infiniband/ulp/srp/ib_srp.c b/drivers/infiniband/ulp/srp/ib_srp.c
index ef8d55dca136..b291278674d8 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;
}