Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 82518
b: refs/heads/master
c: 124d3b7
h: refs/heads/master
v: v3
  • Loading branch information
Nick Piggin authored and Linus Torvalds committed Feb 2, 2008
1 parent 68a2166 commit ed84f61
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 6598b60fd56ba5e915a001cc4e307880a94d19ae
refs/heads/master: 124d3b7041f9a0ca7c43a6293e1cae4576c32fd5
8 changes: 6 additions & 2 deletions trunk/mm/filemap.c
Original file line number Diff line number Diff line change
Expand Up @@ -1750,7 +1750,11 @@ static void __iov_iter_advance_iov(struct iov_iter *i, size_t bytes)
const struct iovec *iov = i->iov;
size_t base = i->iov_offset;

while (bytes) {
/*
* The !iov->iov_len check ensures we skip over unlikely
* zero-length segments.
*/
while (bytes || !iov->iov_len) {
int copy = min(bytes, iov->iov_len - base);

bytes -= copy;
Expand Down Expand Up @@ -2268,6 +2272,7 @@ static ssize_t generic_perform_write(struct file *file,

cond_resched();

iov_iter_advance(i, copied);
if (unlikely(copied == 0)) {
/*
* If we were unable to copy any data at all, we must
Expand All @@ -2281,7 +2286,6 @@ static ssize_t generic_perform_write(struct file *file,
iov_iter_single_seg_count(i));
goto again;
}
iov_iter_advance(i, copied);
pos += copied;
written += copied;

Expand Down

0 comments on commit ed84f61

Please sign in to comment.