summaryrefslogtreecommitdiff
path: root/drivers/scsi/scsi_lib.c
diff options
context:
space:
mode:
authorHannes Reinecke <hare@suse.de>2020-09-30 11:02:54 +0300
committerMartin K. Petersen <martin.petersen@oracle.com>2020-11-11 06:58:12 +0300
commit268940b80fa4096397fd0a28e6ad807e64120215 (patch)
treef1adea276f9b09fb5cf5a63b415352eb66538dbc /drivers/scsi/scsi_lib.c
parente21ee5a6b9c9d30fd07ce5bd3e4a5668a03af6d9 (diff)
downloadlinux-268940b80fa4096397fd0a28e6ad807e64120215.tar.xz
scsi: scsi_dh_alua: Return BLK_STS_AGAIN for ALUA transitioning state
When the ALUA state indicates transitioning we should not retry the command immediately, but rather complete the command with BLK_STS_AGAIN to signal the completion handler that it might be retried. This allows multipathing to redirect the command to another path if possible, and avoid stalls during lengthy transitioning times. Link: https://lore.kernel.org/r/20200930080256.90964-3-hare@suse.de Reviewed-by: Ewan D. Milne <emilne@redhat.com> Signed-off-by: Hannes Reinecke <hare@suse.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/scsi/scsi_lib.c')
-rw-r--r--drivers/scsi/scsi_lib.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c
index 20a357563d3d..7691196f288c 100644
--- a/drivers/scsi/scsi_lib.c
+++ b/drivers/scsi/scsi_lib.c
@@ -1707,6 +1707,11 @@ out_put_budget:
scsi_device_blocked(sdev))
ret = BLK_STS_DEV_RESOURCE;
break;
+ case BLK_STS_AGAIN:
+ scsi_req(req)->result = DID_BUS_BUSY << 16;
+ if (req->rq_flags & RQF_DONTPREP)
+ scsi_mq_uninit_cmd(cmd);
+ break;
default:
if (unlikely(!scsi_device_online(sdev)))
scsi_req(req)->result = DID_NO_CONNECT << 16;