From: Varun Prakash <varun@chelsio.com>
To: sagi@grimberg.me, hch@lst.de
Cc: linux-nvme@lists.infradead.org, varun@chelsio.com,
Rakshana Sridhar <rakshanas@chelsio.com>
Subject: [PATCH] nvmet-tcp: pass iov_len instead of sg->length to bvec_set_page()
Date: Thu, 27 Jul 2023 20:35:50 +0530 [thread overview]
Message-ID: <20230727150550.5851-1-varun@chelsio.com> (raw)
iov_len is the valid data length, so pass iov_len instead of sg->length to
bvec_set_page().
Fixes: 5bfaba275ae6 ("nvmet-tcp: don't map pages which can't come from HIGHMEM")
Signed-off-by: Rakshana Sridhar <rakshanas@chelsio.com>
Signed-off-by: Varun Prakash <varun@chelsio.com>
---
drivers/nvme/target/tcp.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/nvme/target/tcp.c b/drivers/nvme/target/tcp.c
index 868aa4de2e4c..05163751f2e5 100644
--- a/drivers/nvme/target/tcp.c
+++ b/drivers/nvme/target/tcp.c
@@ -348,8 +348,8 @@ static void nvmet_tcp_build_pdu_iovec(struct nvmet_tcp_cmd *cmd)
while (length) {
u32 iov_len = min_t(u32, length, sg->length - sg_offset);
- bvec_set_page(iov, sg_page(sg), sg->length,
- sg->offset + sg_offset);
+ bvec_set_page(iov, sg_page(sg), iov_len,
+ sg->offset + sg_offset);
length -= iov_len;
sg = sg_next(sg);
--
2.31.1
next reply other threads:[~2023-07-27 14:40 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-07-27 15:05 Varun Prakash [this message]
2023-07-31 5:59 ` [PATCH] nvmet-tcp: pass iov_len instead of sg->length to bvec_set_page() Christoph Hellwig
2023-07-31 9:13 ` Sagi Grimberg
2023-07-31 13:41 ` Sagi Grimberg
2023-07-31 18:30 ` Varun Prakash
2023-07-31 19:38 ` hch
2023-08-01 7:34 ` Sagi Grimberg
2023-08-01 8:19 ` Varun Prakash
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=20230727150550.5851-1-varun@chelsio.com \
--to=varun@chelsio.com \
--cc=hch@lst.de \
--cc=linux-nvme@lists.infradead.org \
--cc=rakshanas@chelsio.com \
--cc=sagi@grimberg.me \
/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