From: Hugh Dickins Date: Tue, 26 Jul 2011 00:12:25 +0000 (-0700) Subject: mm: pincer in truncate_inode_pages_range X-Git-Tag: firefly_0821_release~3680^2~4933^2~82 X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=d0823576bf4b8eafce1b56f98613465a0352a376;p=firefly-linux-kernel-4.4.55.git mm: pincer in truncate_inode_pages_range 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 Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/mm/truncate.c b/mm/truncate.c index dc459014f777..232eb2736a79 100644 --- a/mm/truncate.c +++ b/mm/truncate.c @@ -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; }