Skip to content

Commit

Permalink
[PATCH] fix race in pagevec_strip?
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
Christoph Lameter authored and Linus Torvalds committed Mar 17, 2006
1 parent 8ba32fd commit 5b40dc7
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion mm/swap.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
Expand Down

0 comments on commit 5b40dc7

Please sign in to comment.