Commit 5b40dc78 authored by Christoph Lameter's avatar Christoph Lameter Committed by Linus Torvalds

[PATCH] fix race in pagevec_strip?

We can call try_to_release_page() with PagePrivate off and a valid
page->mapping This may cause all sorts of trouble for the filesystem
*_releasepage() handlers.  XFS bombs out in that case.

Lock the page before checking for page private.
Signed-off-by: default avatarChristoph Lameter <clameter@sgi.com>
Cc: Nick Piggin <nickpiggin@yahoo.com.au>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 8ba32fde
...@@ -393,7 +393,8 @@ void pagevec_strip(struct pagevec *pvec) ...@@ -393,7 +393,8 @@ void pagevec_strip(struct pagevec *pvec)
struct page *page = pvec->pages[i]; struct page *page = pvec->pages[i];
if (PagePrivate(page) && !TestSetPageLocked(page)) { if (PagePrivate(page) && !TestSetPageLocked(page)) {
try_to_release_page(page, 0); if (PagePrivate(page))
try_to_release_page(page, 0);
unlock_page(page); unlock_page(page);
} }
} }
......
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