scsi: core: sanitize++ in progress
authorDouglas Gilbert <dgilbert@interlog.com>
Fri, 18 May 2018 23:25:47 +0000 (19:25 -0400)
committerMartin K. Petersen <martin.petersen@oracle.com>
Tue, 29 May 2018 01:29:46 +0000 (21:29 -0400)
Commit 505aa4b6a883 ("scsi: sd: Defer spinning up drive while SANITIZE is
in progress") may not be sufficient, especially if the SCSI SANITIZE
command is sent via the bsg or sg pass-throughs, since they don't use the
sd driver.

Add "Sanitize in progress" plus some other recent "... in progress"
additional sense codes into the scsi mid-level so they are treated in a
similar fashion to "Format in progress".

[mkp: checkpatch]

Signed-off-by: Douglas Gilbert <dgilbert@interlog.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/scsi_lib.c

index e9b4f279d29cb1de2b59f897b2f462bb8f7d3c9a..9df5fbdbc85475e7a55355a8cfd777b5ae55f666 100644 (file)
@@ -985,6 +985,10 @@ void scsi_io_completion(struct scsi_cmnd *cmd, unsigned int good_bytes)
                                case 0x08: /* Long write in progress */
                                case 0x09: /* self test in progress */
                                case 0x14: /* space allocation in progress */
+                               case 0x1a: /* start stop unit in progress */
+                               case 0x1b: /* sanitize in progress */
+                               case 0x1d: /* configuration in progress */
+                               case 0x24: /* depopulation in progress */
                                        action = ACTION_DELAYED_RETRY;
                                        break;
                                default: