From: Trond Myklebust Fix invalidate_inode_pages2_range() so that it does not immediately exit just because a single page in the specified range could not be removed. Signed-off-by: Trond Myklebust Signed-off-by: Andrew Morton --- mm/truncate.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff -puN mm/truncate.c~vm-invalidate_inode_pages2_range-should-not-exit-early mm/truncate.c --- a/mm/truncate.c~vm-invalidate_inode_pages2_range-should-not-exit-early +++ a/mm/truncate.c @@ -375,10 +375,10 @@ int invalidate_inode_pages2_range(struct pagevec_init(&pvec, 0); next = start; - while (next <= end && !ret && !wrapped && + while (next <= end && !wrapped && pagevec_lookup(&pvec, mapping, next, min(end - next, (pgoff_t)PAGEVEC_SIZE - 1) + 1)) { - for (i = 0; !ret && i < pagevec_count(&pvec); i++) { + for (i = 0; i < pagevec_count(&pvec); i++) { struct page *page = pvec.pages[i]; pgoff_t page_index; _