From 8a3375e459caef6fe639e3fb95ca834ac2add816 Mon Sep 17 00:00:00 2001 From: yayang1 Date: Fri, 28 Sep 2018 02:31:28 +0000 Subject: [PATCH] Fix the 0 blocks writesame failed when target claims supporting maximum writesame length to LUN's total blocks number. When target claim it support maximum writesame length to the total blocks number, when we trigger 0blocks writesame opertion, we should expect it to be succeed instread of failure. --- test-tool/test_writesame10_0blocks.c | 2 +- test-tool/test_writesame16_0blocks.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/test-tool/test_writesame10_0blocks.c b/test-tool/test_writesame10_0blocks.c index cfbb064..2bc7270 100644 --- a/test-tool/test_writesame10_0blocks.c +++ b/test-tool/test_writesame10_0blocks.c @@ -53,7 +53,7 @@ test_writesame10_0blocks(void) return; } - if (inq_bl->max_ws_len > 0 && num_blocks >= inq_bl->max_ws_len) { + if (inq_bl->max_ws_len > 0 && num_blocks > inq_bl->max_ws_len) { WRITESAME10(sd, 0, block_size, 0, 0, 0, 0, 0, scratch, EXPECT_INVALID_FIELD_IN_CDB); } else { diff --git a/test-tool/test_writesame16_0blocks.c b/test-tool/test_writesame16_0blocks.c index adc56a5..90cc88b 100644 --- a/test-tool/test_writesame16_0blocks.c +++ b/test-tool/test_writesame16_0blocks.c @@ -48,7 +48,7 @@ test_writesame16_0blocks(void) } - if (inq_bl->max_ws_len > 0 && num_blocks >= inq_bl->max_ws_len) { + if (inq_bl->max_ws_len > 0 && num_blocks > inq_bl->max_ws_len) { WRITESAME16(sd, 0, block_size, 0, 0, 0, 0, 0, scratch, EXPECT_INVALID_FIELD_IN_CDB); } else {