From mboxrd@z Thu Jan 1 00:00:00 1970 From: "K. Y. Srinivasan" Subject: [PATCH RESEND 2/2] Drivers: scsi: storvsc: Don't pass ATA_16 command to the host Date: Sun, 18 Mar 2012 13:00:17 -0700 Message-ID: <1332100817-25646-2-git-send-email-kys@microsoft.com> References: <1332100789-25594-1-git-send-email-kys@microsoft.com> <1332100817-25646-1-git-send-email-kys@microsoft.com> Return-path: Received: from p3plsmtps2ded01.prod.phx3.secureserver.net ([208.109.80.58]:33239 "HELO p3plsmtps2ded01-01.prod.phx3.secureserver.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1756474Ab2CRTxU (ORCPT ); Sun, 18 Mar 2012 15:53:20 -0400 In-Reply-To: <1332100817-25646-1-git-send-email-kys@microsoft.com> Sender: linux-scsi-owner@vger.kernel.org List-Id: linux-scsi@vger.kernel.org To: gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org, devel@linuxdriverproject.org, virtualization@lists.osdl.org, ohering@suse.com, jbottomley@parallels.com, hch@infradead.org, linux-scsi@vger.kernel.org Cc: "K. Y. Srinivasan" The current Windows hosts don't handle the ATA_16 command and furthermore return a generic error code after filtering the command on the host side. For now filter the command on the guest side until the host is modified to properly handle unsupported commands. I would like to thank Jeff Garzik and Douglas Gilbert for suggesting the correct approach here. Signed-off-by: K. Y. Srinivasan Reviewed-by: Haiyang Zhang --- drivers/scsi/storvsc_drv.c | 14 +++++++++++++- 1 files changed, 13 insertions(+), 1 deletions(-) diff --git a/drivers/scsi/storvsc_drv.c b/drivers/scsi/storvsc_drv.c index d5448e8..e9e37dd 100644 --- a/drivers/scsi/storvsc_drv.c +++ b/drivers/scsi/storvsc_drv.c @@ -1233,9 +1233,21 @@ static bool storvsc_scsi_cmd_ok(struct scsi_cmnd *scmnd) /* * smartd sends this command and the host does not handle * this. So, don't send it. + * The current Windows hosts implement a subset of scsi commands + * and for the commands that are not implemented, the host filters + * them and returns a generic failure SRB status. I have been in + * discussions with the Windows team to return the appropriate SRB + * status code for unsupported scsi commands and while they have + * agreed to implement this, it is not clear when this change will be + * available. Consequently, filtering the command before submitting it + * to the host is a resonable interim solution. */ case SET_WINDOW: - scmnd->result = ILLEGAL_REQUEST << 16; + case ATA_16: + scmnd->result = ((DRIVER_SENSE << 24) | + SAM_STAT_CHECK_CONDITION); + scsi_build_sense_buffer(0, scmnd->sense_buffer, + ILLEGAL_REQUEST, 0x20, 0); allowed = false; break; default: -- 1.7.4.1