summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--mm/iov_iter.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/mm/iov_iter.c b/mm/iov_iter.c
index 081e3273085b..fcdaaab438b6 100644
--- a/mm/iov_iter.c
+++ b/mm/iov_iter.c
@@ -74,6 +74,10 @@ size_t copy_page_to_iter(struct page *page, size_t offset, size_t bytes,
}
kunmap(page);
done:
+ if (skip == iov->iov_len) {
+ iov++;
+ skip = 0;
+ }
i->count -= wanted - bytes;
i->nr_segs -= iov - i->iov;
i->iov = iov;
@@ -152,6 +156,10 @@ size_t copy_page_from_iter(struct page *page, size_t offset, size_t bytes,
}
kunmap(page);
done:
+ if (skip == iov->iov_len) {
+ iov++;
+ skip = 0;
+ }
i->count -= wanted - bytes;
i->nr_segs -= iov - i->iov;
i->iov = iov;