Commit 8ad0935b authored by Shuhei Matsumoto's avatar Shuhei Matsumoto Committed by Changpeng Liu
Browse files

bdevperf: Fix incorrect error detection and log for IO size



g_io_size is already verified not to be zero when args are originally parsed,
and if g_io_size < data_block_size, then g_io_size % data_block_size != 0.

So current error log is not correct and just testing if IO size is multiples
of block size will be correct.

Change-Id: I5d32425e251773f1c96740c674b4d238dfb80f8d
Signed-off-by: default avatarShuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-on: https://review.gerrithub.io/c/444310


Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
Reviewed-by: default avatarChangpeng Liu <changpeng.liu@intel.com>
parent 3c3510a2
Loading
Loading
Loading
Loading
+2 −3
Original line number Diff line number Diff line
@@ -275,9 +275,8 @@ bdevperf_construct_target(struct spdk_bdev *bdev, struct io_target **_target)
	}
	data_block_size = block_size - md_size;
	target->io_size_blocks = g_io_size / data_block_size;
	if (target->io_size_blocks == 0 || (g_io_size % data_block_size) != 0) {
		SPDK_ERRLOG("IO size (%d) is bigger than data block size of bdev %s (%"PRIu32") or"
			    " not a data block size multiple\n",
	if ((g_io_size % data_block_size) != 0) {
		SPDK_ERRLOG("IO size (%d) is not multiples of data block size of bdev %s (%"PRIu32")\n",
			    g_io_size, spdk_bdev_get_name(bdev), data_block_size);
		spdk_bdev_close(target->bdev_desc);
		free(target->name);