From e57b266e91bc2e89d37cede4139c47bad71f5546 Mon Sep 17 00:00:00 2001 From: Ronnie Sahlberg Date: Sat, 19 Sep 2015 14:41:52 -0700 Subject: [PATCH] TESTS: Fix how we compute the max transfer length the bus can handle was broken Signed-off-by: Ronnie Sahlberg --- test-tool/iscsi-test-cu.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/test-tool/iscsi-test-cu.c b/test-tool/iscsi-test-cu.c index 4d950a7..5646b74 100644 --- a/test-tool/iscsi-test-cu.c +++ b/test-tool/iscsi-test-cu.c @@ -57,7 +57,7 @@ int loglevel = LOG_NORMAL; struct scsi_device *sd = NULL; /* mp_sds[0] alias */ -static unsigned int maxsectbytes; +static unsigned int maxsectors; /* * this allows us to redefine how PDU are queued, at times, for @@ -962,7 +962,7 @@ static int connect_scsi_device(struct scsi_device *sdev, const char *initiatorna close(sdev->sgio_fd); return -1; } - if (ioctl(sdev->sgio_fd, BLKSECTGET, &maxsectbytes) < 0) { + if (ioctl(sdev->sgio_fd, BLKSECTGET, &maxsectors) < 0) { fprintf(stderr, "%s failed to read BLKMAXSECT\n", sdev->sgio_dev); close(sdev->sgio_fd); return -1; @@ -1344,10 +1344,10 @@ main(int argc, char *argv[]) } scsi_free_scsi_task(task); - if (maxsectbytes) { - maximum_transfer_length = maxsectbytes / block_size; - printf("Bus transfer size is limited to %d bytes. Clamping " - "max transfers accordingly.\n", maxsectbytes); + if (maxsectors) { + maximum_transfer_length = maxsectors; + printf("Bus transfer size is limited to %d blocks. Clamping " + "max transfers accordingly.\n", maxsectors); } if (CU_initialize_registry() != 0) {