Commit 43ba6161 authored by Varun Prakash's avatar Varun Prakash Committed by Khalid Elmously

scsi: csiostor: fix missing data copy in csio_scsi_err_handler()

BugLink: https://bugs.launchpad.net/bugs/1830176

[ Upstream commit 5c2442fd ]

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: default avatarVarun Prakash <varun@chelsio.com>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
Signed-off-by: default avatarJuerg Haefliger <juergh@canonical.com>
Signed-off-by: default avatarKleber Sacilotto de Souza <kleber.souza@canonical.com>
parent 467aa56b
...@@ -1713,8 +1713,11 @@ csio_scsi_err_handler(struct csio_hw *hw, struct csio_ioreq *req) ...@@ -1713,8 +1713,11 @@ csio_scsi_err_handler(struct csio_hw *hw, struct csio_ioreq *req)
} }
out: out:
if (req->nsge > 0) if (req->nsge > 0) {
scsi_dma_unmap(cmnd); 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->result = (((host_status) << 16) | scsi_status);
cmnd->scsi_done(cmnd); cmnd->scsi_done(cmnd);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment