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 <bvanassche@acm.org>
This commit is contained in:
@@ -41,10 +41,10 @@ test_compareandwrite_miscompare(void)
|
|||||||
maxbl = inq_bl->max_cmp;
|
maxbl = inq_bl->max_cmp;
|
||||||
} else {
|
} else {
|
||||||
/* Assume we are not limited */
|
/* Assume we are not limited */
|
||||||
maxbl = 256;
|
maxbl = 255;
|
||||||
}
|
}
|
||||||
|
|
||||||
n = 256;
|
n = 255;
|
||||||
if (n + 0U > num_blocks)
|
if (n + 0U > num_blocks)
|
||||||
n = num_blocks;
|
n = num_blocks;
|
||||||
|
|
||||||
|
|||||||
@@ -41,10 +41,10 @@ test_compareandwrite_simple(void)
|
|||||||
maxbl = inq_bl->max_cmp;
|
maxbl = inq_bl->max_cmp;
|
||||||
} else {
|
} else {
|
||||||
/* Assume we are not limited */
|
/* Assume we are not limited */
|
||||||
maxbl = 256;
|
maxbl = 255;
|
||||||
}
|
}
|
||||||
|
|
||||||
n = 256;
|
n = 255;
|
||||||
if (n + 0U > num_blocks)
|
if (n + 0U > num_blocks)
|
||||||
n = num_blocks;
|
n = num_blocks;
|
||||||
if (maxbl + 0U > num_blocks)
|
if (maxbl + 0U > num_blocks)
|
||||||
|
|||||||
@@ -44,14 +44,14 @@ test_multipathio_compareandwrite(void)
|
|||||||
maxbl = inq_bl->max_cmp;
|
maxbl = inq_bl->max_cmp;
|
||||||
} else {
|
} else {
|
||||||
/* Assume we are not limited */
|
/* Assume we are not limited */
|
||||||
maxbl = 256;
|
maxbl = 255;
|
||||||
}
|
}
|
||||||
if (maxbl < io_bl) {
|
if (maxbl < io_bl) {
|
||||||
CU_PASS("[SKIPPED] MAXIMUM_COMPARE_AND_WRITE_LENGTH too small");
|
CU_PASS("[SKIPPED] MAXIMUM_COMPARE_AND_WRITE_LENGTH too small");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
n = 256;
|
n = 255;
|
||||||
if (n + 0U > num_blocks)
|
if (n + 0U > num_blocks)
|
||||||
n = num_blocks;
|
n = num_blocks;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user