1
0
Fork 0

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

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>
hifive-unleashed-5.1
Varun Prakash 2019-04-05 20:39:13 +05:30 committed by Martin K. Petersen
parent 4eb0153588
commit 5c2442fd78
1 changed files with 4 additions and 1 deletions

View 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);