Re: [PATCH 38/40] Staging: hv: storvsc: Fixup srb_status for INQUIRY and MODE_SENSE
On Thu, Jun 30, 2011 at 07:59:28PM +, KY Srinivasan wrote: The reason I did this was so that I could key off on real failures indicated by srb_status == 0x4 to off-line the device. Ok. Please document what your doing in detail in the code, though. ___ Virtualization mailing list Virtualization@lists.linux-foundation.org https://lists.linux-foundation.org/mailman/listinfo/virtualization
RE: [PATCH 38/40] Staging: hv: storvsc: Fixup srb_status for INQUIRY and MODE_SENSE
-Original Message- From: Christoph Hellwig [mailto:h...@infradead.org] Sent: Thursday, June 30, 2011 3:48 PM To: KY Srinivasan Cc: gre...@suse.de; linux-ker...@vger.kernel.org; de...@linuxdriverproject.org; virtualizat...@lists.osdl.org; Haiyang Zhang; Abhishek Kane (Mindtree Consulting PVT LTD); Hank Janssen Subject: Re: [PATCH 38/40] Staging: hv: storvsc: Fixup srb_status for INQUIRY and MODE_SENSE On Wed, Jun 29, 2011 at 07:39:35AM -0700, K. Y. Srinivasan wrote: The current handler on the Windows Host does not correctly handle INQUIRY and MODE_SENSE commands with some options. Fixup srb_status in these cases since the failure is not fatal. + /* +* The current SCSI handling on the host side does +* not correctly handle: +* INQUIRY command with page code parameter set to 0x80 +* MODE_SENSE command with cmd[2] == 0x1c +* +* Setup srb status so this won't be fatal. +*/ + + if ((stor_pkt-vm_srb.cdb[0] == INQUIRY) || + (stor_pkt-vm_srb.cdb[0] == MODE_SENSE)) + vstor_packet-vm_srb.srb_status = 0; Given that the srb_status is only used for debug printks I don't quite see the point. If people explicitly turn on debugging they should see that these commands fail, shouldn't they? The reason I did this was so that I could key off on real failures indicated by srb_status == 0x4 to off-line the device. Regards, K. Y ___ Virtualization mailing list Virtualization@lists.linux-foundation.org https://lists.linux-foundation.org/mailman/listinfo/virtualization
Re: [PATCH 38/40] Staging: hv: storvsc: Fixup srb_status for INQUIRY and MODE_SENSE
On Wed, Jun 29, 2011 at 07:39:35AM -0700, K. Y. Srinivasan wrote: The current handler on the Windows Host does not correctly handle INQUIRY and MODE_SENSE commands with some options. Fixup srb_status in these cases since the failure is not fatal. + /* + * The current SCSI handling on the host side does + * not correctly handle: + * INQUIRY command with page code parameter set to 0x80 + * MODE_SENSE command with cmd[2] == 0x1c + * + * Setup srb status so this won't be fatal. + */ + + if ((stor_pkt-vm_srb.cdb[0] == INQUIRY) || +(stor_pkt-vm_srb.cdb[0] == MODE_SENSE)) + vstor_packet-vm_srb.srb_status = 0; Given that the srb_status is only used for debug printks I don't quite see the point. If people explicitly turn on debugging they should see that these commands fail, shouldn't they? ___ Virtualization mailing list Virtualization@lists.linux-foundation.org https://lists.linux-foundation.org/mailman/listinfo/virtualization
[PATCH 38/40] Staging: hv: storvsc: Fixup srb_status for INQUIRY and MODE_SENSE
The current handler on the Windows Host does not correctly handle INQUIRY and MODE_SENSE commands with some options. Fixup srb_status in these cases since the failure is not fatal. Signed-off-by: K. Y. Srinivasan k...@microsoft.com Signed-off-by: Haiyang Zhang haiya...@microsoft.com Signed-off-by: Abhishek Kane v-abk...@microsoft.com Signed-off-by: Hank Janssen hjans...@microsoft.com --- drivers/staging/hv/storvsc_drv.c | 12 1 files changed, 12 insertions(+), 0 deletions(-) diff --git a/drivers/staging/hv/storvsc_drv.c b/drivers/staging/hv/storvsc_drv.c index 42689d3..0785947 100644 --- a/drivers/staging/hv/storvsc_drv.c +++ b/drivers/staging/hv/storvsc_drv.c @@ -542,6 +542,18 @@ static void storvsc_on_io_completion(struct hv_device *device, stor_pkt = request-vstor_packet; + /* +* The current SCSI handling on the host side does +* not correctly handle: +* INQUIRY command with page code parameter set to 0x80 +* MODE_SENSE command with cmd[2] == 0x1c +* +* Setup srb status so this won't be fatal. +*/ + + if ((stor_pkt-vm_srb.cdb[0] == INQUIRY) || + (stor_pkt-vm_srb.cdb[0] == MODE_SENSE)) + vstor_packet-vm_srb.srb_status = 0; /* Copy over the status...etc */ stor_pkt-vm_srb.scsi_status = vstor_packet-vm_srb.scsi_status; -- 1.7.4.1 ___ Virtualization mailing list Virtualization@lists.linux-foundation.org https://lists.linux-foundation.org/mailman/listinfo/virtualization