aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
authorDominique Martinet <asmadeus@codewreck.org>2025-08-11 15:51:03 +0900
committerDominique Martinet <asmadeus@codewreck.org>2026-05-29 02:16:39 +0000
commit6335c463f9162962ff700673c91a5de3c9fa3556 (patch)
tree15dbc9c57ed1df69f82eed7694de9059c8e356f2 /lib
parent6b4f48728faa8bb514368f7eacda05565dea8696 (diff)
downloadlinux-next-history-6335c463f9162962ff700673c91a5de3c9fa3556.tar.gz
iov_iter: iov_folioq_get_pages: don't leave empty slot behind
After advancing into a folioq it makes more sense to point to the next slot than at the end of the current slot. This should not be needed for correctness, but this also happens to "fix" the 9p bug with iterate_folioq() not copying properly. Acked-by: David Howells <dhowells@redhat.com> Tested-by: Arnout Engelen <arnout@bzzt.net> Signed-off-by: Dominique Martinet <asmadeus@codewreck.org>
Diffstat (limited to 'lib')
-rw-r--r--lib/iov_iter.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/iov_iter.c b/lib/iov_iter.c
index 0a63c7fba3135..70e9cce888d13 100644
--- a/lib/iov_iter.c
+++ b/lib/iov_iter.c
@@ -949,9 +949,6 @@ static ssize_t iter_folioq_get_pages(struct iov_iter *iter,
maxpages--;
}
- if (maxpages == 0 || extracted >= maxsize)
- break;
-
if (iov_offset >= fsize) {
iov_offset = 0;
slot++;
@@ -960,6 +957,9 @@ static ssize_t iter_folioq_get_pages(struct iov_iter *iter,
slot = 0;
}
}
+
+ if (maxpages == 0 || extracted >= maxsize)
+ break;
}
iter->count = count;