lib/bdev: print num_blocks and the write_unit_size in SPDK_ERRLOG

Print out the specific values in this SPDK_ERRLOG,
this can help to find where the error is.

Change-Id: I2a38aa2d4270e0bbf554ddb348a73d40967d1b16
Signed-off-by: wanghailiangx <hailiangx.e.wang@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/15618
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: GangCao <gang.cao@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@nvidia.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Community-CI: Mellanox Build Bot
This commit is contained in:
wanghailiangx 2022-11-24 08:42:29 -05:00 committed by Tomasz Zawadzki
parent cb9f9f4c04
commit 0da97a15cc

View File

@ -2195,7 +2195,8 @@ bdev_io_do_submit(struct spdk_bdev_channel *bdev_ch, struct spdk_bdev_io *bdev_i
if (spdk_unlikely(bdev_io->type == SPDK_BDEV_IO_TYPE_WRITE &&
bdev_io->bdev->split_on_write_unit &&
bdev_io->u.bdev.num_blocks < bdev_io->bdev->write_unit_size)) {
SPDK_ERRLOG("IO does not match the write_unit_size\n");
SPDK_ERRLOG("IO num_blocks %lu does not match the write_unit_size %u\n",
bdev_io->u.bdev.num_blocks, bdev_io->bdev->write_unit_size);
_bdev_io_complete_in_submit(bdev_ch, bdev_io, SPDK_BDEV_IO_STATUS_FAILED);
return;
}