Skip to content

Commit e8dfe63

Browse files
ipylypivjfvogel
authored andcommitted
scsi: core: Do not retry I/Os during depopulation
commit 9ff7c383b8ac0c482a1da7989f703406d78445c6 upstream. 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: [email protected] # 4.18.x: 2bbeb8d scsi: core: Handle depopulation and restoration in progress Cc: [email protected] # 4.18.x Fixes: e37c7d9 ("scsi: core: sanitize++ in progress") Signed-off-by: Igor Pylypiv <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Martin K. Petersen <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]> (cherry picked from commit 8db25d4c4a4876a96b0597486b029d03ddd7bfce) Signed-off-by: Jack Vogel <[email protected]>
1 parent 0462549 commit e8dfe63

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

Diff for: drivers/scsi/scsi_lib.c

+7-2
Original file line numberDiff line numberDiff line change
@@ -865,13 +865,18 @@ static void scsi_io_completion_action(struct scsi_cmnd *cmd, int result)
865865
case 0x1a: /* start stop unit in progress */
866866
case 0x1b: /* sanitize in progress */
867867
case 0x1d: /* configuration in progress */
868-
case 0x24: /* depopulation in progress */
869-
case 0x25: /* depopulation restore in progress */
870868
action = ACTION_DELAYED_RETRY;
871869
break;
872870
case 0x0a: /* ALUA state transition */
873871
action = ACTION_DELAYED_REPREP;
874872
break;
873+
/*
874+
* Depopulation might take many hours,
875+
* thus it is not worthwhile to retry.
876+
*/
877+
case 0x24: /* depopulation in progress */
878+
case 0x25: /* depopulation restore in progress */
879+
fallthrough;
875880
default:
876881
action = ACTION_FAIL;
877882
break;

0 commit comments

Comments
 (0)