public inbox for linux-nvme@lists.infradead.org
 help / color / mirror / Atom feed
* [PATCH v2] nvmet-tcp: pass iov_len instead of sg->length to bvec_set_page()
@ 2023-08-01 11:57 Varun Prakash
  2023-08-01 13:41 ` Christoph Hellwig
  0 siblings, 1 reply; 2+ messages in thread
From: Varun Prakash @ 2023-08-01 11:57 UTC (permalink / raw)
  To: sagi, hch; +Cc: linux-nvme, varun, Rakshana Sridhar

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>
---

v2: removed alignment change

 drivers/nvme/target/tcp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/nvme/target/tcp.c b/drivers/nvme/target/tcp.c
index 868aa4de2e4c..cd92d7ddf5ed 100644
--- a/drivers/nvme/target/tcp.c
+++ b/drivers/nvme/target/tcp.c
@@ -348,7 +348,7 @@ 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,
+		bvec_set_page(iov, sg_page(sg), iov_len,
 				sg->offset + sg_offset);
 
 		length -= iov_len;
-- 
2.31.1



^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH v2] nvmet-tcp: pass iov_len instead of sg->length to bvec_set_page()
  2023-08-01 11:57 [PATCH v2] nvmet-tcp: pass iov_len instead of sg->length to bvec_set_page() Varun Prakash
@ 2023-08-01 13:41 ` Christoph Hellwig
  0 siblings, 0 replies; 2+ messages in thread
From: Christoph Hellwig @ 2023-08-01 13:41 UTC (permalink / raw)
  To: Varun Prakash; +Cc: sagi, hch, linux-nvme, Rakshana Sridhar

Looks good,

Reviewed-by: Christoph Hellwig <hch@lst.de>


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-08-01 13:41 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-08-01 11:57 [PATCH v2] nvmet-tcp: pass iov_len instead of sg->length to bvec_set_page() Varun Prakash
2023-08-01 13:41 ` Christoph Hellwig

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox