Skip to content

Commit 2bbeb8d

Browse files
doug-gilbertmartinkpetersen
authored andcommitted
scsi: core: Handle depopulation and restoration in progress
The default handling of the NOT READY sense key is to wait for the device to become ready. The "wait" is assumed to be relatively short. However there is a sub-class of NOT READY that have the "... in progress" phrase in their additional sense code and these can take much longer. Following on from commit 505aa4b ("scsi: sd: Defer spinning up drive while SANITIZE is in progress") we now have element depopulation and restoration that can take a long time. For example, over 24 hours for a 20 TB, 7200 rpm hard disk to depopulate 1 of its 20 elements. Add handling of ASC/ASCQ: 0x4,0x24 (depopulation in progress) and ASC/ASCQ: 0x4,0x25 (depopulation restoration in progress) to sd.c . The scsi_lib.c has incomplete handling of these two messages, so complete it. Signed-off-by: Douglas Gilbert <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Martin K. Petersen <[email protected]>
1 parent 72208eb commit 2bbeb8d

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

Diff for: drivers/scsi/scsi_lib.c

+1
Original file line numberDiff line numberDiff line change
@@ -774,6 +774,7 @@ static void scsi_io_completion_action(struct scsi_cmnd *cmd, int result)
774774
case 0x1b: /* sanitize in progress */
775775
case 0x1d: /* configuration in progress */
776776
case 0x24: /* depopulation in progress */
777+
case 0x25: /* depopulation restore in progress */
777778
action = ACTION_DELAYED_RETRY;
778779
break;
779780
case 0x0a: /* ALUA state transition */

Diff for: drivers/scsi/sd.c

+4
Original file line numberDiff line numberDiff line change
@@ -2227,6 +2227,10 @@ sd_spinup_disk(struct scsi_disk *sdkp)
22272227
break; /* unavailable */
22282228
if (sshdr.asc == 4 && sshdr.ascq == 0x1b)
22292229
break; /* sanitize in progress */
2230+
if (sshdr.asc == 4 && sshdr.ascq == 0x24)
2231+
break; /* depopulation in progress */
2232+
if (sshdr.asc == 4 && sshdr.ascq == 0x25)
2233+
break; /* depopulation restoration in progress */
22302234
/*
22312235
* Issue command to spin up drive when not ready
22322236
*/

0 commit comments

Comments
 (0)