Fix WRITE SAME data buffer length handling

From the SPC-4 paragraph about WRITE SAME(10): "The WRITE SAME (10)
command requests that the device server transfer a single logical
block from the Data-Out Buffer [ ... ]". Hence always pass a data
buffer when sending a WRITE SAME(10) command.

Set the NDOB bit in the WRITE SAME(16) command if no data out buffer
is present.

Signed-off-by: Bart Van Assche <bvanassche@acm.org>
This commit is contained in:
Bart Van Assche
2014-08-18 08:37:30 +02:00
committed by Ronnie Sahlberg
parent e8c4be8f62
commit ded75ae18a
6 changed files with 22 additions and 15 deletions

View File

@@ -29,6 +29,7 @@ void
test_writesame10_unmap_unaligned(void)
{
int i, ret;
unsigned char *buf = alloca(block_size);
CHECK_FOR_DATALOSS;
CHECK_FOR_THIN_PROVISIONING;
@@ -42,7 +43,7 @@ test_writesame10_unmap_unaligned(void)
logging(LOG_VERBOSE, "Unmap %d blocks using WRITESAME10 at LBA:%d", lbppb - i, i);
ret = writesame10_invalidfieldincdb(iscsic, tgt_lun, i,
block_size, lbppb - i,
0, 1, 0, 0, NULL);
0, 1, 0, 0, buf);
CU_ASSERT_EQUAL(ret, 0);
}
}