Commit ffc548bb authored by Bart Van Assche's avatar Bart Van Assche Committed by Doug Ledford

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
Signed-off-by: default avatarBart Van Assche <>
Cc: Christoph Hellwig <>
Cc: Sagi Grimberg <>
Cc: Laurence Oberman <>
Reviewed-by: default avatarChristoph Hellwig <>
Signed-off-by: default avatarDoug Ledford <>
parent fa9863f8
......@@ -1681,6 +1681,8 @@ map_complete:
srp_unmap_data(scmnd, ch, req);
if (ret == -ENOMEM && req->nmdesc >= target->mr_pool_size)
ret = -E2BIG;
return ret;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment