IB/srp: Avoid that mapping failure triggers an infinite loop
authorBart Van Assche <bart.vanassche@sandisk.com>
Fri, 22 Apr 2016 21:14:15 +0000 (14:14 -0700)
committerDoug Ledford <dledford@redhat.com>
Thu, 12 May 2016 18:18:56 +0000 (14:18 -0400)
commitffc548bb3601f0250474afcfa10ceb0b8b8b9764
tree5aa96222de3017d7d3cea3182b678aaa2b7223a4
parentfa9863f869202a4ccc673cbd8dd326bf54a8efff
IB/srp: Avoid that mapping failure triggers an infinite loop

The srp_queuecommand() function translates ENOMEM into QUEUE_FULL
which causes the SCSI mid-layer to retry the command. All other
error codes are translated into DID_ERROR which causes the SCSI
command to fail. Return E2BIG if mapping will always fail to
prevent that the SCSI mid-layer keeps resubmitting a command
forever.

Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
Cc: Christoph Hellwig <hch@lst.de>
Cc: Sagi Grimberg <sagi@grimberg.me>
Cc: Laurence Oberman <loberman@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Doug Ledford <dledford@redhat.com>
drivers/infiniband/ulp/srp/ib_srp.c