]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
mm/page-writeback: check-before-clear PageReclaim
authorNaoya Horiguchi <n-horiguchi@ah.jp.nec.com>
Tue, 7 Apr 2015 23:44:23 +0000 (09:44 +1000)
committerStephen Rothwell <sfr@canb.auug.org.au>
Tue, 7 Apr 2015 23:44:23 +0000 (09:44 +1000)
With the page flag sanitization patchset, an invalid usage of
ClearPageReclaim() is detected in set_page_dirty().  This can be called
from __unmap_hugepage_range(), so let's check PageReclaim() before trying
to clear it to avoid the misuse.

Signed-off-by: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>
Acked-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
mm/page-writeback.c

index 0372411f38fc516dd64cd6432cce29ee613facf4..5daf5568b9e149ea9dce0383b0452bd30ad67f84 100644 (file)
@@ -2228,7 +2228,8 @@ int set_page_dirty(struct page *page)
                 * it will confuse readahead and make it restart the size rampup
                 * process. But it's a trivial problem.
                 */
-               ClearPageReclaim(page);
+               if (PageReclaim(page))
+                       ClearPageReclaim(page);
 #ifdef CONFIG_BLOCK
                if (!spd)
                        spd = __set_page_dirty_buffers;