提交 0bcc4025 编写于 作者: D David Howells 提交者: Linus Torvalds

netfs: Fix netfs_extract_iter_to_sg() for ITER_UBUF/IOVEC

Fix netfs_extract_iter_to_sg() for ITER_UBUF and ITER_IOVEC to set the
size of the page to the part of the page extracted, not the remaining
amount of data in the extracted page array at that point.

This doesn't yet affect anything as cifs, the only current user, only
passes in non-user-backed iterators.

Fixes: 01858469 ("netfs: Add a function to extract an iterator into a scatterlist")
Signed-off-by: NDavid Howells <dhowells@redhat.com>
Reviewed-by: NJeff Layton <jlayton@kernel.org>
Cc: Steve French <sfrench@samba.org>
Cc: Shyam Prasad N <nspmangalore@gmail.com>
Cc: Rohith Surabattula <rohiths.msft@gmail.com>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 e62252bc
...@@ -139,7 +139,7 @@ static ssize_t netfs_extract_user_to_sg(struct iov_iter *iter, ...@@ -139,7 +139,7 @@ static ssize_t netfs_extract_user_to_sg(struct iov_iter *iter,
size_t seg = min_t(size_t, PAGE_SIZE - off, len); size_t seg = min_t(size_t, PAGE_SIZE - off, len);
*pages++ = NULL; *pages++ = NULL;
sg_set_page(sg, page, len, off); sg_set_page(sg, page, seg, off);
sgtable->nents++; sgtable->nents++;
sg++; sg++;
len -= seg; len -= seg;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册