Commit 0a9237b2 authored by Suparna Bhattacharya's avatar Suparna Bhattacharya Committed by Linus Torvalds

[PATCH] mpage writepages range limit fix

Safeguard to make sure we break out of pagevec_lookup_tag loop if we are
beyond the specified range.
Signed-off-by: default avatarSuparna Bhattacharya <suparna@in.ibm.com>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 013a3540
......@@ -654,7 +654,8 @@ mpage_writepages(struct address_space *mapping,
scanned = 1;
}
retry:
while (!done && (nr_pages = pagevec_lookup_tag(&pvec, mapping, &index,
while (!done && (index <= end) &&
(nr_pages = pagevec_lookup_tag(&pvec, mapping, &index,
PAGECACHE_TAG_DIRTY,
min(end - index, (pgoff_t)PAGEVEC_SIZE-1) + 1))) {
unsigned i;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment