Skip to content

Commit 1f0bbf2

Browse files
Varun Prakashkeithbusch
authored andcommitted
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: 5bfaba2 ("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>
1 parent 851e062 commit 1f0bbf2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/nvme/target/tcp.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -348,7 +348,7 @@ static void nvmet_tcp_build_pdu_iovec(struct nvmet_tcp_cmd *cmd)
348348
while (length) {
349349
u32 iov_len = min_t(u32, length, sg->length - sg_offset);
350350

351-
bvec_set_page(iov, sg_page(sg), sg->length,
351+
bvec_set_page(iov, sg_page(sg), iov_len,
352352
sg->offset + sg_offset);
353353

354354
length -= iov_len;

0 commit comments

Comments
 (0)