From e7300bfb8ba1f926e03a0d77ec02f069f67ff031 Mon Sep 17 00:00:00 2001 From: Ronnie Sahlberg Date: Mon, 4 Apr 2011 18:33:29 +1000 Subject: [PATCH] READ10: only set R flag in iscsi if we are reading >0 blocks. If we are reading 0 blocks, the R flag should be clear --- lib/scsi-lowlevel.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/scsi-lowlevel.c b/lib/scsi-lowlevel.c index 2fa08e6..6f19824 100644 --- a/lib/scsi-lowlevel.c +++ b/lib/scsi-lowlevel.c @@ -525,7 +525,11 @@ scsi_cdb_read10(uint32_t lba, uint32_t xferlen, int blocksize) *(uint16_t *)&task->cdb[7] = htons(xferlen/blocksize); task->cdb_size = 10; - task->xfer_dir = SCSI_XFER_READ; + if (xferlen != 0) { + task->xfer_dir = SCSI_XFER_READ; + } else { + task->xfer_dir = SCSI_XFER_NONE; + } task->expxferlen = xferlen; task->params.read10.lba = lba;