Commit 1f0bbf28 authored by Varun Prakash's avatar Varun Prakash Committed by Keith Busch

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: 5bfaba27 ("nvmet-tcp: don't map pages which can't come from HIGHMEM")
Signed-off-by: default avatarRakshana Sridhar <rakshanas@chelsio.com>
Signed-off-by: default avatarVarun Prakash <varun@chelsio.com>
Reviewed-by: default avatarSagi Grimberg <sagi@grimberg.me>
Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
Signed-off-by: default avatarKeith Busch <kbusch@kernel.org>
parent 851e0629
......@@ -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;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment