On Tue, 2006-12-19 at 02:32 -0800, Andrew Morton wrote:
Well it used to be. After 2.6.19 it can do the wrong thing for mapped
pages. But it turns out that we don't feed it mapped pages, apart from
pagevec_strip() and possibly races against pagefaults.
So how about this:
Index: linux-2.6-git/mm/page-writeback.c
===================================================================
--- linux-2.6-git.orig/mm/page-writeback.c 2006-12-19 08:24:48.000000000 +0100
+++ linux-2.6-git/mm/page-writeback.c 2006-12-19 11:43:31.000000000 +0100
@@ -859,6 +859,9 @@ int test_clear_page_dirty(struct page *p
struct address_space *mapping = page_mapping(page);
unsigned long flags;
+ if (page_mapped(page))
+ return 0;
+
if (!mapping)
return TestClearPageDirty(page);
-