mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* Race in pagevec_strip?
@ 2006-03-16 18:36 Christoph Lameter
  2006-03-16 18:57 ` Christoph Lameter
  0 siblings, 1 reply; 8+ messages in thread
From: Christoph Lameter @ 2006-03-16 18:36 UTC (permalink / raw)
  To: Hugh Dickins; +Cc: linux-kernel, akpm

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);
 		}
 	}

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2006-03-17 18:11 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-03-16 18:36 Race in pagevec_strip? Christoph Lameter
2006-03-16 18:57 ` Christoph Lameter
2006-03-16 19:44   ` Hugh Dickins
2006-03-16 19:49     ` Christoph Lameter
2006-03-16 20:02     ` Hugh Dickins
2006-03-17  0:50       ` Christoph Lameter
2006-03-17 18:05         ` Hugh Dickins
2006-03-17 18:11           ` Christoph Lameter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®