From: Wu Fengguang Date: Wed, 16 Dec 2009 11:19:58 +0000 (+0100) Subject: HWPOISON: comment the possible set_page_dirty() race X-Git-Tag: v2.6.33-rc1~45^2~25 X-Git-Url: http://ftp.safe.ca/?p=safe%2Fjmp%2Flinux-2.6;a=commitdiff_plain;h=db0480b3a61bd6ad86ead3b8bbad094ab0996932 HWPOISON: comment the possible set_page_dirty() race Signed-off-by: Wu Fengguang Signed-off-by: Andi Kleen --- diff --git a/mm/memory-failure.c b/mm/memory-failure.c index b62287d..dc47415 100644 --- a/mm/memory-failure.c +++ b/mm/memory-failure.c @@ -687,6 +687,8 @@ static int hwpoison_user_mappings(struct page *p, unsigned long pfn, /* * Propagate the dirty bit from PTEs to struct page first, because we * need this to decide if we should kill or just drop the page. + * XXX: the dirty test could be racy: set_page_dirty() may not always + * be called inside page lock (it's recommended but not enforced). */ mapping = page_mapping(p); if (!PageDirty(p) && mapping && mapping_cap_writeback_dirty(mapping)) {