Commit a617e395 authored by K. Y. Srinivasan's avatar K. Y. Srinivasan Committed by Greg Kroah-Hartman

Staging: hv: Properly capture the error state

Properly capture the error state after the completion of I/O. This fixes a bug
that was introduced in the patch-set titled:
Staging: hv: Cleanup-storage-drivers-phase-II.
A corrected version of this patch-set was sent out earlier, however
the earlier (buggy) version of this patch-set was already applied.
This patch fixes the problem.
Signed-off-by: default avatarK. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: default avatarHank Janssen <hjanssen@microsoft.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 03068ff1
...@@ -279,6 +279,7 @@ static void stor_vsc_on_io_completion(struct hv_device *device, ...@@ -279,6 +279,7 @@ static void stor_vsc_on_io_completion(struct hv_device *device,
struct hv_storvsc_request *request) struct hv_storvsc_request *request)
{ {
struct storvsc_device *stor_device; struct storvsc_device *stor_device;
struct vstor_packet *stor_pkt;
stor_device = must_get_stor_device(device); stor_device = must_get_stor_device(device);
if (!stor_device) { if (!stor_device) {
...@@ -291,15 +292,20 @@ static void stor_vsc_on_io_completion(struct hv_device *device, ...@@ -291,15 +292,20 @@ static void stor_vsc_on_io_completion(struct hv_device *device,
"completed bytes xfer %u", request, "completed bytes xfer %u", request,
vstor_packet->vm_srb.data_transfer_length); vstor_packet->vm_srb.data_transfer_length);
stor_pkt = &request->vstor_packet;
/* Copy over the status...etc */ /* Copy over the status...etc */
stor_pkt->vm_srb.scsi_status = vstor_packet->vm_srb.scsi_status;
stor_pkt->vm_srb.srb_status = vstor_packet->vm_srb.srb_status;
stor_pkt->vm_srb.sense_info_length =
vstor_packet->vm_srb.sense_info_length;
if (vstor_packet->vm_srb.scsi_status != 0 || if (vstor_packet->vm_srb.scsi_status != 0 ||
vstor_packet->vm_srb.srb_status != 1) { vstor_packet->vm_srb.srb_status != 1) {
DPRINT_WARN(STORVSC, DPRINT_WARN(STORVSC,
"cmd 0x%x scsi status 0x%x srb status 0x%x\n", "cmd 0x%x scsi status 0x%x srb status 0x%x\n",
vstor_packet->vm_srb.cdb[0], stor_pkt->vm_srb.cdb[0],
vstor_packet->vm_srb.scsi_status, vstor_packet->vm_srb.scsi_status,
vstor_packet->vm_srb.srb_status); vstor_packet->vm_srb.srb_status);
} }
...@@ -319,6 +325,8 @@ static void stor_vsc_on_io_completion(struct hv_device *device, ...@@ -319,6 +325,8 @@ static void stor_vsc_on_io_completion(struct hv_device *device,
} }
} }
stor_pkt->vm_srb.data_transfer_length =
vstor_packet->vm_srb.data_transfer_length;
request->on_io_completion(request); request->on_io_completion(request);
...@@ -535,6 +543,7 @@ int stor_vsc_on_io_request(struct hv_device *device, ...@@ -535,6 +543,7 @@ int stor_vsc_on_io_request(struct hv_device *device,
request->device = device; request->device = device;
vstor_packet->flags |= REQUEST_COMPLETION_FLAG; vstor_packet->flags |= REQUEST_COMPLETION_FLAG;
vstor_packet->vm_srb.length = sizeof(struct vmscsi_request); vstor_packet->vm_srb.length = sizeof(struct vmscsi_request);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment