Skip to content

Commit 505aa4b

Browse files
Mahesh Rajashekharamartinkpetersen
Mahesh Rajashekhara
authored andcommitted
scsi: sd: Defer spinning up drive while SANITIZE is in progress
A drive being sanitized will return NOT READY / ASC 0x4 / ASCQ 0x1b ("LOGICAL UNIT NOT READY. SANITIZE IN PROGRESS"). Prevent spinning up the drive until this condition clears. [mkp: tweaked commit message] Signed-off-by: Mahesh Rajashekhara <[email protected]> Cc: <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
1 parent fb1633d commit 505aa4b

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

drivers/scsi/sd.c

+2
Original file line numberDiff line numberDiff line change
@@ -2121,6 +2121,8 @@ sd_spinup_disk(struct scsi_disk *sdkp)
21212121
break; /* standby */
21222122
if (sshdr.asc == 4 && sshdr.ascq == 0xc)
21232123
break; /* unavailable */
2124+
if (sshdr.asc == 4 && sshdr.ascq == 0x1b)
2125+
break; /* sanitize in progress */
21242126
/*
21252127
* Issue command to spin up drive when not ready
21262128
*/

0 commit comments

Comments
 (0)