]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
scsi: csiostor: fix missing data copy in csio_scsi_err_handler()
authorVarun Prakash <varun@chelsio.com>
Fri, 5 Apr 2019 15:09:13 +0000 (20:39 +0530)
committerMartin K. Petersen <martin.petersen@oracle.com>
Tue, 9 Apr 2019 02:18:35 +0000 (22:18 -0400)
If scsi cmd sglist is not suitable for DDP then csiostor driver uses
preallocated buffers for DDP, because of this data copy is required from
DDP buffer to scsi cmd sglist before calling ->scsi_done().

Signed-off-by: Varun Prakash <varun@chelsio.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/csiostor/csio_scsi.c

index 462560b2855e25e1204064c89350fed5653bf36a..469d0bc9f5fe4db6e756e4270bf522e63cd15566 100644 (file)
@@ -1713,8 +1713,11 @@ csio_scsi_err_handler(struct csio_hw *hw, struct csio_ioreq *req)
        }
 
 out:
-       if (req->nsge > 0)
+       if (req->nsge > 0) {
                scsi_dma_unmap(cmnd);
+               if (req->dcopy && (host_status == DID_OK))
+                       host_status = csio_scsi_copy_to_sgl(hw, req);
+       }
 
        cmnd->result = (((host_status) << 16) | scsi_status);
        cmnd->scsi_done(cmnd);