From 178b3ec5b956bb87113981934ac858862c4d403b Mon Sep 17 00:00:00 2001 From: Ronnie Sahlberg Date: Sat, 7 Jan 2017 08:57:45 -0800 Subject: [PATCH] XCOPY: Only set the write flag if we actually have DATA-OUT Signed-off-by: Ronnie Sahlberg --- lib/scsi-lowlevel.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/scsi-lowlevel.c b/lib/scsi-lowlevel.c index 9c98c62..9626cd2 100644 --- a/lib/scsi-lowlevel.c +++ b/lib/scsi-lowlevel.c @@ -3421,7 +3421,9 @@ scsi_cdb_extended_copy(int param_len) task->cdb[13] = param_len & 0xFF; /* Inititalize other fields in CDB */ task->cdb_size = 16; - task->xfer_dir = SCSI_XFER_WRITE; + if (param_len) { + task->xfer_dir = SCSI_XFER_WRITE; + } task->expxferlen = param_len; return task;