aboutsummaryrefslogtreecommitdiffstats
path: root/mm
diff options
context:
space:
mode:
authorChristoph Lameter <clameter@sgi.com>2006-03-17 02:04:07 -0500
committerLinus Torvalds <torvalds@g5.osdl.org>2006-03-17 10:51:25 -0500
commit5b40dc780ed996162f3af8712eb03beb24dcdbef (patch)
tree17035c1d501390f00efac6895ee663c45d4fb699 /mm
parent8ba32fde2c5be52865b2fd7e5e3752a46971fabe (diff)
[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: Christoph Lameter <clameter@sgi.com> Cc: Nick Piggin <nickpiggin@yahoo.com.au> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'mm')
-rw-r--r--mm/swap.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/mm/swap.c b/mm/swap.c
index e9ec06d845e8..b524ea90bddb 100644
--- a/mm/swap.c
+++ b/mm/swap.c
@@ -393,7 +393,8 @@ void pagevec_strip(struct pagevec *pvec)
393 struct page *page = pvec->pages[i]; 393 struct page *page = pvec->pages[i];
394 394
395 if (PagePrivate(page) && !TestSetPageLocked(page)) { 395 if (PagePrivate(page) && !TestSetPageLocked(page)) {
396 try_to_release_page(page, 0); 396 if (PagePrivate(page))
397 try_to_release_page(page, 0);
397 unlock_page(page); 398 unlock_page(page);
398 } 399 }
399 } 400 }