Skip to content

Commit

Permalink
scsi: csiostor: fix missing data copy in csio_scsi_err_handler()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Varun Prakash authored and Martin K. Petersen committed Apr 9, 2019
1 parent 4eb0153 commit 5c2442f
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion drivers/scsi/csiostor/csio_scsi.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 5c2442f

Please sign in to comment.