summaryrefslogtreecommitdiffstats
path: root/drivers/nvme
diff options
context:
space:
mode:
authorVarun Prakash <varun@chelsio.com>2023-08-09 15:56:45 +0530
committerKeith Busch <kbusch@kernel.org>2023-08-21 12:54:02 -0700
commit1f0bbf28940cf5edad90ab57b62aa8197bf5e836 (patch)
treefc4be806fe8841ee24d20c7a3224d780edc6f1d5 /drivers/nvme
parent851e06297f20bbd85c93bbf09469f2150d1db218 (diff)
downloadlinux-stable-1f0bbf28940cf5edad90ab57b62aa8197bf5e836.tar.gz
linux-stable-1f0bbf28940cf5edad90ab57b62aa8197bf5e836.tar.bz2
linux-stable-1f0bbf28940cf5edad90ab57b62aa8197bf5e836.zip
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") Signed-off-by: Rakshana Sridhar <rakshanas@chelsio.com> Signed-off-by: Varun Prakash <varun@chelsio.com> Reviewed-by: Sagi Grimberg <sagi@grimberg.me> Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Keith Busch <kbusch@kernel.org>
Diffstat (limited to 'drivers/nvme')
-rw-r--r--drivers/nvme/target/tcp.c2
1 files changed, 1 insertions, 1 deletions
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;