scsi: storvsc: properly set residual data length on errors
authorLong Li <longli@microsoft.com>
Thu, 15 Dec 2016 02:46:03 +0000 (18:46 -0800)
committerWilly Tarreau <w@1wt.eu>
Tue, 20 Jun 2017 12:03:22 +0000 (14:03 +0200)
commitd49e93f927b14e1ac95aaa5847ee1175b177a07c
treedb71f92f709ec8452a5c4fa35bd01e55ca0129fd
parentd9b6a466adbf115d0428eff73ef78e7d01646396
scsi: storvsc: properly set residual data length on errors

commit 40630f462824ee24bc00d692865c86c3828094e0 upstream.

On I/O errors, the Windows driver doesn't set data_transfer_length
on error conditions other than SRB_STATUS_DATA_OVERRUN.
In these cases we need to set data_transfer_length to 0,
indicating there is no data transferred. On SRB_STATUS_DATA_OVERRUN,
data_transfer_length is set by the Windows driver to the actual data transferred.

Reported-by: Shiva Krishna <Shiva.Krishna@nimblestorage.com>
Signed-off-by: Long Li <longli@microsoft.com>
Reviewed-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Willy Tarreau <w@1wt.eu>
drivers/scsi/storvsc_drv.c