scsi: storvsc: Filter out storvsc messages CD-ROM medium not present
authorCathy Avery <cavery@redhat.com>
Mon, 23 May 2016 14:29:17 +0000 (10:29 -0400)
committerMartin K. Petersen <martin.petersen@oracle.com>
Wed, 13 Jul 2016 03:16:31 +0000 (23:16 -0400)
When a virtual scsi DVD device is present with no image file
attached the storvsc driver logs all resulting unnecessary sense errors
whenever IO is issued to the device.

[storvsc] Sense Key : Not Ready [current]
[storvsc] Add. Sense: Medium not present - tray closed

[mkp: Fixed whitespace]

Signed-off-by: Cathy Avery <cavery@redhat.com>
Reviewed-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/storvsc_drv.c

index 3ddcabb790a892f5383379f985b8b26ff7bd76c0..8ccfc9ea874bc2eb1b6197fdcfec72ca2c876d9a 100644 (file)
@@ -966,6 +966,8 @@ static void storvsc_command_completion(struct storvsc_cmd_request *cmd_request,
        if (scmnd->result) {
                if (scsi_normalize_sense(scmnd->sense_buffer,
                                SCSI_SENSE_BUFFERSIZE, &sense_hdr) &&
+                   !(sense_hdr.sense_key == NOT_READY &&
+                                sense_hdr.asc == 0x03A) &&
                    do_logging(STORVSC_LOGGING_ERROR))
                        scsi_print_sense_hdr(scmnd->device, "storvsc",
                                             &sense_hdr);