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

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
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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;