test-tool: Give up if READ CAPACITY reports that the block size is zero
Since the test tool can't proceed in a meaningful way if the block size is zero, give up if the SCSI target reports that the block size is zero. Signed-off-by: Bart Van Assche <bvanassche@acm.org>
This commit is contained in:
@@ -1301,6 +1301,10 @@ main(int argc, char *argv[])
|
|||||||
block_size = rc10->block_size;
|
block_size = rc10->block_size;
|
||||||
num_blocks = rc10->lba + 1;
|
num_blocks = rc10->lba + 1;
|
||||||
scsi_free_scsi_task(task);
|
scsi_free_scsi_task(task);
|
||||||
|
if (block_size == 0) {
|
||||||
|
printf("block_size is zero - giving up.\n");
|
||||||
|
goto err_sds_free;
|
||||||
|
}
|
||||||
|
|
||||||
rc16_task = NULL;
|
rc16_task = NULL;
|
||||||
readcapacity16(sd, &rc16_task, 96, EXPECT_STATUS_GOOD);
|
readcapacity16(sd, &rc16_task, 96, EXPECT_STATUS_GOOD);
|
||||||
@@ -1318,6 +1322,10 @@ main(int argc, char *argv[])
|
|||||||
block_size = rc16->block_length;
|
block_size = rc16->block_length;
|
||||||
num_blocks = rc16->returned_lba + 1;
|
num_blocks = rc16->returned_lba + 1;
|
||||||
lbppb = 1 << rc16->lbppbe;
|
lbppb = 1 << rc16->lbppbe;
|
||||||
|
if (block_size == 0) {
|
||||||
|
printf("block_size is zero - giving up.\n");
|
||||||
|
goto err_sds_free;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* create a really big buffer we can use in the tests */
|
/* create a really big buffer we can use in the tests */
|
||||||
|
|||||||
Reference in New Issue
Block a user