[SRU][Trusty][PATCH 1/1] scsi: storvsc: Filter out storvsc messages CD-ROM medium not present

Joseph Salisbury joseph.salisbury at canonical.com
Wed Aug 24 17:13:45 UTC 2016

From: Cathy Avery <cavery at redhat.com>

BugLink: http://bugs.launchpad.net/bugs/1590655

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 at redhat.com>
Reviewed-by: K. Y. Srinivasan <kys at microsoft.com>
Signed-off-by: Martin K. Petersen <martin.petersen at oracle.com>
(backported from commit 84b342c0f4dc0180ad4ac701b46024761ff4af11)
Signed-off-by: Joseph Salisbury <joseph.salisbury at canonical.com>
 drivers/scsi/storvsc_drv.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/scsi/storvsc_drv.c b/drivers/scsi/storvsc_drv.c
index 96eb66c..fa846f9 100644
--- a/drivers/scsi/storvsc_drv.c
+++ b/drivers/scsi/storvsc_drv.c
@@ -1106,7 +1106,9 @@ 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))
+				SCSI_SENSE_BUFFERSIZE, &sense_hdr) &&
+		    !(sense_hdr.sense_key == NOT_READY &&
+				 sense_hdr.asc == 0x03A))
 			scsi_print_sense_hdr("storvsc", &sense_hdr);

More information about the kernel-team mailing list