Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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/20220210095817.22828-7-sreekanth.reddy@broadcom.com
Signed-off-by: Sreekanth Reddy <sreekanth.reddy@broadcom.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>

authored by

Sreekanth Reddy and committed by
Martin K. Petersen
99922461 b3911ab3

+2
+2
drivers/scsi/mpi3mr/mpi3mr_os.c
··· 2600 2600 scmd->result = DID_OK << 16; 2601 2601 goto out_success; 2602 2602 } 2603 + 2604 + scsi_set_resid(scmd, scsi_bufflen(scmd) - xfer_count); 2603 2605 if (ioc_status == MPI3_IOCSTATUS_SCSI_DATA_UNDERRUN && 2604 2606 xfer_count == 0 && (scsi_status == MPI3_SCSI_STATUS_BUSY || 2605 2607 scsi_status == MPI3_SCSI_STATUS_RESERVATION_CONFLICT ||