Skip to contentSkip to conversation

nvmet-tcp: pass iov_len instead of sg->length to bvec_set_page()

PATCH RESEND Applied Varun Prakash 2 participants 2 messages Aug 9, 2023 – Aug 22, 2023

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH RESEND v2 1/1 nvmet-tcp: pass iov_len instead of sg->length to bvec_set_page()

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

---

v2: removed alignment change

 drivers/nvme/target/tcp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/nvme/target/tcp.c +1 -1
index 868aa4de2e4c..cd92d7ddf5ed 100644
@@ -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;
Signature · 1 line
2.27.0