projects/linux·commit 5b40dc78

[PATCH] fix race in pagevec_strip?

5b40dc78 · Christoph Lameter <[email protected]> · 2006-03-16 23:04:07 -08:00

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: Christoph Lameter <[email protected]>
Cc: Nick Piggin <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
Commit
5b40dc780ed996162f3af8712eb03beb24dcdbef
Parents
8ba32fde

Changes

1 files changed · +2 −1

FileStatusAddDelContent
mm/swap.cmodified+2−1View file

mm/swap.c

View file
diff --git a/mm/swap.c b/mm/swap.c
index e9ec06d..b524ea9 100644
--- a/mm/swap.c
+++ b/mm/swap.c
@@ -393,7 +393,8 @@ void pagevec_strip(struct pagevec *pvec)
struct page *page = pvec->pages[i];
if (PagePrivate(page) && !TestSetPageLocked(page)) {
- try_to_release_page(page, 0);
+ if (PagePrivate(page))
+ try_to_release_page(page, 0);
unlock_page(page);
}
}