summaryrefslogtreecommitdiffstats
path: root/drivers/staging/hv/storvsc_drv.c
diff options
context:
space:
mode:
authorK. Y. Srinivasan2011-08-27 20:31:26 +0200
committerGreg Kroah-Hartman2011-08-29 20:01:08 +0200
commit4ed51a21c0f69e1379cf858fc21a9d9022bfe0e7 (patch)
tree36611f9171bc6ed7cf8193612406156ed6be6c71 /drivers/staging/hv/storvsc_drv.c
parentStaging: hv: storvsc: Cleanup storvsc_drv.c after adding the contents of hype... (diff)
downloadkernel-qcow2-linux-4ed51a21c0f69e1379cf858fc21a9d9022bfe0e7.tar.gz
kernel-qcow2-linux-4ed51a21c0f69e1379cf858fc21a9d9022bfe0e7.tar.xz
kernel-qcow2-linux-4ed51a21c0f69e1379cf858fc21a9d9022bfe0e7.zip
Staging: hv: storvsc: Fixup srb and scsi status for INQUIRY and MODE_SENSE
The current VHD 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 <kys@microsoft.com> Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/staging/hv/storvsc_drv.c')
-rw-r--r--drivers/staging/hv/storvsc_drv.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/drivers/staging/hv/storvsc_drv.c b/drivers/staging/hv/storvsc_drv.c
index 0bb4e0e48983..72ca25c4b8e2 100644
--- a/drivers/staging/hv/storvsc_drv.c
+++ b/drivers/staging/hv/storvsc_drv.c
@@ -512,6 +512,23 @@ 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 and scsi status so this won't be fatal.
+ * We do this so we can distinguish truly fatal failues
+ * (srb status == 0x4) and off-line the device in that case.
+ */
+
+ if ((stor_pkt->vm_srb.cdb[0] == INQUIRY) ||
+ (stor_pkt->vm_srb.cdb[0] == MODE_SENSE)) {
+ vstor_packet->vm_srb.scsi_status = 0;
+ vstor_packet->vm_srb.srb_status = 0x1;
+ }
+
/* Copy over the status...etc */
stor_pkt->vm_srb.scsi_status = vstor_packet->vm_srb.scsi_status;