From: Naoya Horiguchi Date: Wed, 15 Apr 2015 23:13:17 +0000 (-0700) Subject: mm/page-writeback: check-before-clear PageReclaim X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=a4bb3ecdc12a78dc4d0e690d40ec10887b640786;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git mm/page-writeback: check-before-clear PageReclaim 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 Acked-by: Kirill A. Shutemov Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/mm/page-writeback.c b/mm/page-writeback.c index 0372411f38fc..5daf5568b9e1 100644 --- a/mm/page-writeback.c +++ b/mm/page-writeback.c @@ -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;