Skip to content

Commit 8c8174d

Browse files
author
Ewan D. Milne
committed
scsi: core: Do not retry I/Os during depopulation
JIRA: https://issues.redhat.com/browse/RHEL-86156 Upstream Status: From upstream linux mainline Fail I/Os instead of retry to prevent user space processes from being blocked on the I/O completion for several minutes. Retrying I/Os during "depopulation in progress" or "depopulation restore in progress" results in a continuous retry loop until the depopulation completes or until the I/O retry loop is aborted due to a timeout by the scsi_cmd_runtime_exceeced(). Depopulation is slow and can take 24+ hours to complete on 20+ TB HDDs. Most I/Os in the depopulation retry loop end up taking several minutes before returning the failure to user space. Cc: stable@vger.kernel.org # 4.18.x: 2bbeb8d scsi: core: Handle depopulation and restoration in progress Cc: stable@vger.kernel.org # 4.18.x Fixes: e37c7d9 ("scsi: core: sanitize++ in progress") Signed-off-by: Igor Pylypiv <ipylypiv@google.com> Link: https://lore.kernel.org/r/20250131184408.859579-1-ipylypiv@google.com Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com> (cherry picked from commit 9ff7c38) Signed-off-by: Ewan D. Milne <emilne@redhat.com>
1 parent efede10 commit 8c8174d

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

drivers/scsi/scsi_lib.c

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -876,13 +876,18 @@ static void scsi_io_completion_action(struct scsi_cmnd *cmd, int result)
876876
case 0x1a: /* start stop unit in progress */
877877
case 0x1b: /* sanitize in progress */
878878
case 0x1d: /* configuration in progress */
879-
case 0x24: /* depopulation in progress */
880-
case 0x25: /* depopulation restore in progress */
881879
action = ACTION_DELAYED_RETRY;
882880
break;
883881
case 0x0a: /* ALUA state transition */
884882
action = ACTION_DELAYED_REPREP;
885883
break;
884+
/*
885+
* Depopulation might take many hours,
886+
* thus it is not worthwhile to retry.
887+
*/
888+
case 0x24: /* depopulation in progress */
889+
case 0x25: /* depopulation restore in progress */
890+
fallthrough;
886891
default:
887892
action = ACTION_FAIL;
888893
break;

0 commit comments

Comments
 (0)