Skip to content

Commit

Permalink
Staging: hv: storvsc: In case of scsi errors offline the device
Browse files Browse the repository at this point in the history
When we do get fatal errors from the host, offline the device since the
host has already tried all possible recovery actions.

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>
  • Loading branch information
K. Y. Srinivasan authored and Greg Kroah-Hartman committed Aug 29, 2011
1 parent b8de73d commit 2544b79
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion drivers/staging/hv/storvsc_drv.c
Original file line number Diff line number Diff line change
Expand Up @@ -1154,7 +1154,15 @@ static void storvsc_command_completion(struct hv_storvsc_request *request)
}
}

scmnd->result = vm_srb->scsi_status;
/*
* If there is an error; offline the device since all
* error recovery strategies would have already been
* deployed on the host side.
*/
if (vm_srb->srb_status == 0x4)
scmnd->result = DID_TARGET_FAILURE << 16;
else
scmnd->result = vm_srb->scsi_status;

if (scmnd->result) {
if (scsi_normalize_sense(scmnd->sense_buffer,
Expand Down

0 comments on commit 2544b79

Please sign in to comment.