diff options
author | K. Y. Srinivasan <kys@microsoft.com> | 2011-08-27 11:31:28 -0700 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2011-08-29 11:01:09 -0700 |
commit | 2544b794372b63e46384ac4af91c5630e92cf7f4 (patch) | |
tree | b1ea90dec499d6b0030cde37dcb8cac0d092aa62 /drivers/staging/hv/storvsc_drv.c | |
parent | b8de73df1b5143c3d567e707e4dab0b20c82ab54 (diff) |
Staging: hv: storvsc: In case of scsi errors offline the device
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>
Diffstat (limited to 'drivers/staging/hv/storvsc_drv.c')
-rw-r--r-- | drivers/staging/hv/storvsc_drv.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/drivers/staging/hv/storvsc_drv.c b/drivers/staging/hv/storvsc_drv.c index ad0f9d4c5ba..22a1d758620 100644 --- a/drivers/staging/hv/storvsc_drv.c +++ b/drivers/staging/hv/storvsc_drv.c @@ -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, |