From e2a4a77e483e2d40a680b57b13bb08042929df1c Mon Sep 17 00:00:00 2001 From: Xiaoguang Wang Date: Thu, 13 Apr 2023 18:47:14 +0800 Subject: [PATCH] t/io_uring: fix max_blocks calculation in nvme passthrough mode nvme_id_ns's nsze has already been counted in logical blocks, so there is no need to divide by bs. Signed-off-by: Xiaoguang Wang Link: https://lore.kernel.org/r/20230413104714.57703-1-xiaoguang.wang@linux.alibaba.com Signed-off-by: Jens Axboe --- t/io_uring.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/t/io_uring.c b/t/io_uring.c index 504f8ce9..f9f4b840 100644 --- a/t/io_uring.c +++ b/t/io_uring.c @@ -704,7 +704,7 @@ static int get_file_size(struct file *f) bs, lbs); return -1; } - f->max_blocks = nlba / bs; + f->max_blocks = nlba; f->max_size = nlba; f->lba_shift = ilog2(lbs); return 0; -- 2.25.1