Commit a4bb3ecd authored by Naoya Horiguchi's avatar Naoya Horiguchi Committed by Linus Torvalds

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: default avatarNaoya Horiguchi <n-horiguchi@ah.jp.nec.com>
Acked-by: default avatarKirill A. Shutemov <kirill.shutemov@linux.intel.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent b3b3a99c
...@@ -2228,7 +2228,8 @@ int set_page_dirty(struct page *page) ...@@ -2228,7 +2228,8 @@ int set_page_dirty(struct page *page)
* it will confuse readahead and make it restart the size rampup * it will confuse readahead and make it restart the size rampup
* process. But it's a trivial problem. * process. But it's a trivial problem.
*/ */
ClearPageReclaim(page); if (PageReclaim(page))
ClearPageReclaim(page);
#ifdef CONFIG_BLOCK #ifdef CONFIG_BLOCK
if (!spd) if (!spd)
spd = __set_page_dirty_buffers; spd = __set_page_dirty_buffers;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment