From 33c66f2c39a01b4e109270ffcc83e2e2daf73ecb Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Fri, 15 May 2020 09:53:22 -0700 Subject: [PATCH] test-tool, compare and write: Reduce maximum number of blocks from 256 to 255 Since the NUMBER OF LOGICAL BLOCKS field in the COMPARE AND WRITE command is an 8 bit field, the maximum value that can be encoded is 255. Signed-off-by: Bart Van Assche --- test-tool/test_compareandwrite_miscompare.c | 4 ++-- test-tool/test_compareandwrite_simple.c | 4 ++-- test-tool/test_multipathio_compareandwrite.c | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/test-tool/test_compareandwrite_miscompare.c b/test-tool/test_compareandwrite_miscompare.c index 5f0dbac..3fb6374 100644 --- a/test-tool/test_compareandwrite_miscompare.c +++ b/test-tool/test_compareandwrite_miscompare.c @@ -41,10 +41,10 @@ test_compareandwrite_miscompare(void) maxbl = inq_bl->max_cmp; } else { /* Assume we are not limited */ - maxbl = 256; + maxbl = 255; } - n = 256; + n = 255; if (n + 0U > num_blocks) n = num_blocks; diff --git a/test-tool/test_compareandwrite_simple.c b/test-tool/test_compareandwrite_simple.c index 842cf3b..4fe5594 100644 --- a/test-tool/test_compareandwrite_simple.c +++ b/test-tool/test_compareandwrite_simple.c @@ -41,10 +41,10 @@ test_compareandwrite_simple(void) maxbl = inq_bl->max_cmp; } else { /* Assume we are not limited */ - maxbl = 256; + maxbl = 255; } - n = 256; + n = 255; if (n + 0U > num_blocks) n = num_blocks; if (maxbl + 0U > num_blocks) diff --git a/test-tool/test_multipathio_compareandwrite.c b/test-tool/test_multipathio_compareandwrite.c index 96c47ce..750884e 100644 --- a/test-tool/test_multipathio_compareandwrite.c +++ b/test-tool/test_multipathio_compareandwrite.c @@ -44,14 +44,14 @@ test_multipathio_compareandwrite(void) maxbl = inq_bl->max_cmp; } else { /* Assume we are not limited */ - maxbl = 256; + maxbl = 255; } if (maxbl < io_bl) { CU_PASS("[SKIPPED] MAXIMUM_COMPARE_AND_WRITE_LENGTH too small"); return; } - n = 256; + n = 255; if (n + 0U > num_blocks) n = num_blocks;