diff --git a/test/bdev/bdevio/bdevio.c b/test/bdev/bdevio/bdevio.c index af2e16f76f..54d1712e34 100644 --- a/test/bdev/bdevio/bdevio.c +++ b/test/bdev/bdevio/bdevio.c @@ -419,6 +419,7 @@ static bool blockdev_io_valid_blocks(struct spdk_bdev *bdev, uint64_t data_length) { if (data_length < spdk_bdev_get_block_size(bdev) || + data_length % spdk_bdev_get_block_size(bdev) || data_length / spdk_bdev_get_block_size(bdev) > spdk_bdev_get_num_blocks(bdev)) { return false; }