Skip to contentSkip to conversation

t/io_uring: fix max_blocks calculation in nvme passthrough mode

PATCH Applied Xiaoguang Wang 2 participants 2 messages Apr 13, 2023 io_uring

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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.

---
 t/io_uring.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
t/io_uring.c +1 -1
index 504f8ce9..f9f4b840 100644
@@ -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;
Signature · 1 line
2.19.1.6.gb485710b
maintainer Applied
#1 lore raw
Quoted 4 lines · Xiaoguang Wang

nvme_id_ns's nsze has already been counted in logical blocks, so there is no need to divide by bs.

Applied, thanks!

[1/1] t/io_uring: fix max_blocks calculation in nvme passthrough mode

      commit: e2a4a77e483e2d40a680b57b13bb08042929df1c

Best regards,

Signature · 1 line
Jens Axboe