From patchwork Mon May 23 14:29:17 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cathy Avery X-Patchwork-Id: 9131929 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 9564660761 for ; Mon, 23 May 2016 14:29:40 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8C89928237 for ; Mon, 23 May 2016 14:29:40 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8127A2823D; Mon, 23 May 2016 14:29:40 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3656428237 for ; Mon, 23 May 2016 14:29:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932562AbcEWO3W (ORCPT ); Mon, 23 May 2016 10:29:22 -0400 Received: from mx1.redhat.com ([209.132.183.28]:37123 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755661AbcEWO3U (ORCPT ); Mon, 23 May 2016 10:29:20 -0400 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id E2F606266F; Mon, 23 May 2016 14:29:19 +0000 (UTC) Received: from dhcp-17-98.bos.redhat.com (vpn-57-252.rdu2.redhat.com [10.10.57.252]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u4NETI57024168; Mon, 23 May 2016 10:29:18 -0400 From: Cathy Avery To: linux-scsi@vger.kernel.org Cc: kys@microsoft.com, haiyangz@microsoft.com, martin.petersen@oracle.com, jejb@linux.vnet.ibm.com, devel@linuxdriverproject.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/1] scsi: storvsc: Filter out storvsc messages CD-ROM medium not present Date: Mon, 23 May 2016 10:29:17 -0400 Message-Id: <1464013757-30357-1-git-send-email-cavery@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.26 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Mon, 23 May 2016 14:29:20 +0000 (UTC) Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 Signed-off-by: Cathy Avery Reviewed-by: K. Y. Srinivasan --- 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 3ddcabb..f0efa07 100644 --- a/drivers/scsi/storvsc_drv.c +++ b/drivers/scsi/storvsc_drv.c @@ -966,7 +966,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) && - do_logging(STORVSC_LOGGING_ERROR)) + !(sense_hdr.sense_key == NOT_READY && + sense_hdr.asc == 0x03A) && + do_logging(STORVSC_LOGGING_ERROR)) scsi_print_sense_hdr(scmnd->device, "storvsc", &sense_hdr); }