Skip to content

Commit

Permalink
mm: pincer in truncate_inode_pages_range
Browse files Browse the repository at this point in the history
truncate_inode_pages_range()'s final loop has a nice pincer property,
bringing start and end together, squeezing out the last pages.  But the
range handling missed out on that, just sliding up the range, perhaps
letting pages come in behind it.  Add one more test to give it the same
pincer effect.

Signed-off-by: Hugh Dickins <hughd@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
Hugh Dickins authored and torvalds committed Jul 26, 2011
1 parent b85e0ef commit d082357
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion mm/truncate.c
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ void truncate_inode_pages_range(struct address_space *mapping,
index = start;
continue;
}
if (pvec.pages[0]->index > end) {
if (index == start && pvec.pages[0]->index > end) {
pagevec_release(&pvec);
break;
}
Expand Down

0 comments on commit d082357

Please sign in to comment.