t/io_uring: fix max_blocks calculation in nvme passthrough mode
authorXiaoguang Wang <xiaoguang.wang@linux.alibaba.com>
Thu, 13 Apr 2023 10:47:14 +0000 (18:47 +0800)
committerJens Axboe <axboe@kernel.dk>
Thu, 13 Apr 2023 12:40:32 +0000 (06:40 -0600)
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 <xiaoguang.wang@linux.alibaba.com>
Link: https://lore.kernel.org/r/20230413104714.57703-1-xiaoguang.wang@linux.alibaba.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
t/io_uring.c

index 504f8ce9f1b14a40bc37e19cd0f318e956708913..f9f4b84005b91d4655989901c8a8778b60429897 100644 (file)
@@ -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;