Skip to content

Commit 0bcc402

Browse files
dhowellstorvalds
authored andcommitted
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: 0185846 ("netfs: Add a function to extract an iterator into a scatterlist") Signed-off-by: David Howells <[email protected]> Reviewed-by: Jeff Layton <[email protected]> Cc: Steve French <[email protected]> Cc: Shyam Prasad N <[email protected]> Cc: Rohith Surabattula <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
1 parent e62252b commit 0bcc402

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

fs/netfs/iterator.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ static ssize_t netfs_extract_user_to_sg(struct iov_iter *iter,
139139
size_t seg = min_t(size_t, PAGE_SIZE - off, len);
140140

141141
*pages++ = NULL;
142-
sg_set_page(sg, page, len, off);
142+
sg_set_page(sg, page, seg, off);
143143
sgtable->nents++;
144144
sg++;
145145
len -= seg;

0 commit comments

Comments
 (0)