aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSreekanth Reddy <[email protected]>2022-02-10 15:28:14 +0530
committerMartin K. Petersen <[email protected]>2022-02-11 17:40:04 -0500
commit9992246127246a27cc7184f05cce6f62ac48f84e (patch)
tree792413ccaca4510e65a093755ab8e8855b3d4f7b
parentb3911ab3a76e216cd97c6fdc05132e57c3e6941c (diff)
scsi: mpi3mr: Fix reporting of actual data transfer size
The driver is missing to set the residual size while completing an I/O. Ensure proper data transfer size is reported to the kernel on I/O completion based on the transfer length reported by the firmware. Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Sreekanth Reddy <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
-rw-r--r--drivers/scsi/mpi3mr/mpi3mr_os.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/scsi/mpi3mr/mpi3mr_os.c b/drivers/scsi/mpi3mr/mpi3mr_os.c
index fa4785029e9c..6a913d8fa001 100644
--- a/drivers/scsi/mpi3mr/mpi3mr_os.c
+++ b/drivers/scsi/mpi3mr/mpi3mr_os.c
@@ -2600,6 +2600,8 @@ void mpi3mr_process_op_reply_desc(struct mpi3mr_ioc *mrioc,
scmd->result = DID_OK << 16;
goto out_success;
}
+
+ scsi_set_resid(scmd, scsi_bufflen(scmd) - xfer_count);
if (ioc_status == MPI3_IOCSTATUS_SCSI_DATA_UNDERRUN &&
xfer_count == 0 && (scsi_status == MPI3_SCSI_STATUS_BUSY ||
scsi_status == MPI3_SCSI_STATUS_RESERVATION_CONFLICT ||