summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVarun Prakash <varun@chelsio.com>2019-04-05 18:09:13 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-05-10 19:36:10 +0300
commit3051b6a1a14aebd6f3172caf1f4286de6ced2ac3 (patch)
tree487fd74d4d79e09a8b73f4c26cf0e4420c6a505a
parent353392e5b9a56f59fd9b12e3d51446b7ef7f5119 (diff)
downloadlinux-3051b6a1a14aebd6f3172caf1f4286de6ced2ac3.tar.xz
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 bc5547a62c00..c54c6cd504c4 100644
--- a/drivers/scsi/csiostor/csio_scsi.c
+++ b/drivers/scsi/csiostor/csio_scsi.c
@@ -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);