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: 5bfaba275a ("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>
This commit is contained in:
parent
851e06297f
commit
1f0bbf2894
1 changed files with 1 additions and 1 deletions
|
|
@ -348,7 +348,7 @@ static void nvmet_tcp_build_pdu_iovec(struct nvmet_tcp_cmd *cmd)
|
||||||
while (length) {
|
while (length) {
|
||||||
u32 iov_len = min_t(u32, length, sg->length - sg_offset);
|
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);
|
sg->offset + sg_offset);
|
||||||
|
|
||||||
length -= iov_len;
|
length -= iov_len;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue