diff options
| author | Andriy Gapon <avg@FreeBSD.org> | 2020-01-14 13:20:16 +0000 |
|---|---|---|
| committer | Andriy Gapon <avg@FreeBSD.org> | 2020-01-14 13:20:16 +0000 |
| commit | efdba95d62e573a013dc06552c6bbb0df84dae87 (patch) | |
| tree | 3319cfa47ff9c37958096a44599e8b6630bb7490 /sys/dev/hyperv | |
| parent | 9c6eb0f92f763c247cf59624dbbf79bdf3bd264f (diff) | |
Notes
Diffstat (limited to 'sys/dev/hyperv')
| -rw-r--r-- | sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c | 6 | ||||
| -rw-r--r-- | sys/dev/hyperv/storvsc/hv_vstorage.h | 3 |
2 files changed, 7 insertions, 2 deletions
diff --git a/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c b/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c index a29d9d59e6cb..cab86500ace1 100644 --- a/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c +++ b/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c @@ -2278,7 +2278,11 @@ storvsc_io_done(struct hv_storvsc_request *reqp) } ccb->csio.scsi_status = (vm_srb->scsi_status & 0xFF); - ccb->csio.resid = ccb->csio.dxfer_len - vm_srb->transfer_len; + if (srb_status == SRB_STATUS_SUCCESS || + srb_status == SRB_STATUS_DATA_OVERRUN) + ccb->csio.resid = ccb->csio.dxfer_len - vm_srb->transfer_len; + else + ccb->csio.resid = ccb->csio.dxfer_len; if (reqp->sense_info_len != 0) { csio->sense_resid = csio->sense_len - reqp->sense_info_len; diff --git a/sys/dev/hyperv/storvsc/hv_vstorage.h b/sys/dev/hyperv/storvsc/hv_vstorage.h index ebdda510b609..866623c22e7a 100644 --- a/sys/dev/hyperv/storvsc/hv_vstorage.h +++ b/sys/dev/hyperv/storvsc/hv_vstorage.h @@ -245,7 +245,8 @@ struct vstor_packet { #define SRB_STATUS_SUCCESS 0x01 #define SRB_STATUS_ABORTED 0x02 #define SRB_STATUS_ERROR 0x04 -#define SRB_STATUS_INVALID_LUN 0x20 +#define SRB_STATUS_DATA_OVERRUN 0x12 +#define SRB_STATUS_INVALID_LUN 0x20 /** * SRB Status Masks (can be combined with above status codes) */ |
