TESTS: Dont assume atomic align/granularity is always reported as non-0
From Alexander Motin <mav@freebsd.org> Treat BlockLimits VPD atomic granulatity/alignment reported as 0 (no restrictions) as == 1 (also means no restriction). Both 0 and 1 mean that there is no restriction on alignment or granularity but with the difference being that the second value can be used to increment to the next valid LBA. Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
This commit is contained in:
@@ -53,7 +53,7 @@ test_writeatomic16_simple(void)
|
||||
|
||||
logging(LOG_VERBOSE, "Test WRITEATOMIC16 of 1-256 blocks at the start of the LUN");
|
||||
memset(buf, 0xa6, 256 * block_size);
|
||||
for (i = inq_bl->atomic_gran; i <= 256; i += inq_bl->atomic_gran) {
|
||||
for (i = gran; i <= 256; i += gran) {
|
||||
if (maximum_transfer_length && maximum_transfer_length < i) {
|
||||
break;
|
||||
}
|
||||
@@ -64,7 +64,7 @@ test_writeatomic16_simple(void)
|
||||
}
|
||||
|
||||
logging(LOG_VERBOSE, "Test WRITEATOMIC16 of 1-256 blocks at the end of the LUN");
|
||||
for (i = inq_bl->atomic_gran; i <= 256; i += inq_bl->atomic_gran) {
|
||||
for (i = gran; i <= 256; i += gran) {
|
||||
if (maximum_transfer_length && maximum_transfer_length < i) {
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user