From: Xiaoguang Wang <[email protected]>
To: [email protected]
Cc: [email protected], Xiaoguang Wang <[email protected]>
Subject: [PATCH] t/io_uring: fix max_blocks calculation in nvme passthrough mode
Date: Thu, 13 Apr 2023 18:47:14 +0800 [thread overview]
Message-ID: <[email protected]> (raw)
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 <[email protected]>
---
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.19.1.6.gb485710b
next reply other threads:[~2023-04-13 10:47 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-04-13 10:47 Xiaoguang Wang [this message]
2023-04-13 12:40 ` [PATCH] t/io_uring: fix max_blocks calculation in nvme passthrough mode Jens Axboe
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230413104714.57703-1-xiaoguang.wang@linux.alibaba.com \
[email protected] \
[email protected] \
[email protected] \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox