summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVarun Prakash <varun@chelsio.com>2019-04-05 20:39:13 +0530
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-05-16 09:17:21 +0200
commit47ebd4007edc562723695b93d310bd295b0c652f (patch)
treebb2fe904943e3d35db59bbd4bdc861704581b657
parent0562cef837e24ad57f3b6aa3c3fa98b5140bb585 (diff)
downloadlinux-stable-47ebd4007edc562723695b93d310bd295b0c652f.tar.gz
linux-stable-47ebd4007edc562723695b93d310bd295b0c652f.tar.bz2
linux-stable-47ebd4007edc562723695b93d310bd295b0c652f.zip
scsi: csiostor: fix missing data copy in csio_scsi_err_handler()
[ Upstream commit 5c2442fd78998af60e13aba506d103f7f43f8701 ] 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> Signed-off-by: Sasha Levin <sashal@kernel.org>
-rw-r--r--drivers/scsi/csiostor/csio_scsi.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/scsi/csiostor/csio_scsi.c b/drivers/scsi/csiostor/csio_scsi.c
index 86103c8475d8..fbb2052bc412 100644
--- a/drivers/scsi/csiostor/csio_scsi.c
+++ b/drivers/scsi/csiostor/csio_scsi.c
@@ -1737,8 +1737,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);