lkml.org 
[lkml]   [2006]   [Mar]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: Race in pagevec_strip?
Sigh. TestSetPackLocked works just opposite of spin_trylock. So add an !


Seems that we can call try_to_release_page with PagePrivate off and a
valid 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>

Index: linux-2.6.16-rc6/mm/swap.c
===================================================================
--- linux-2.6.16-rc6.orig/mm/swap.c 2006-03-11 14:12:55.000000000 -0800
+++ linux-2.6.16-rc6/mm/swap.c 2006-03-16 10:15:23.000000000 -0800
@@ -392,8 +392,9 @@ void pagevec_strip(struct pagevec *pvec)
for (i = 0; i < pagevec_count(pvec); i++) {
struct page *page = pvec->pages[i];

- if (PagePrivate(page) && !TestSetPageLocked(page)) {
- try_to_release_page(page, 0);
+ if (!TestSetPageLocked(page)) {
+ if (PagePrivate(page))
+ try_to_release_page(page, 0);
unlock_page(page);
}
}
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
\
 
 \ /
  Last update: 2006-03-16 20:00    [W:0.077 / U:0.144 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site