提交 0d6fdbdb 编写于 作者: N Naoya Horiguchi 提交者: Linus Torvalds

hwpoison: always unset MIGRATE_ISOLATE before returning from soft_offline_page()

Soft offline code expects that MIGRATE_ISOLATE is set on the target page
only during soft offlining work.  But currenly it doesn't work as expected
when get_any_page() fails and returns negative value.  In the result, end
users can have unexpectedly isolated pages.  This patch just fixes it.
Signed-off-by: NNaoya Horiguchi <n-horiguchi@ah.jp.nec.com>
Reviewed-by: NWanpeng Li <liwanp@linux.vnet.ibm.com>
Cc: Andi Kleen <andi@firstfloor.org>
Cc: Fengguang Wu <fengguang.wu@intel.com>
Cc: Tony Luck <tony.luck@intel.com>
Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 cf6fe945
...@@ -1553,7 +1553,7 @@ int soft_offline_page(struct page *page, int flags) ...@@ -1553,7 +1553,7 @@ int soft_offline_page(struct page *page, int flags)
ret = get_any_page(page, pfn, flags); ret = get_any_page(page, pfn, flags);
if (ret < 0) if (ret < 0)
return ret; goto unset;
if (ret) { /* for in-use pages */ if (ret) { /* for in-use pages */
if (PageHuge(page)) if (PageHuge(page))
ret = soft_offline_huge_page(page, flags); ret = soft_offline_huge_page(page, flags);
...@@ -1570,6 +1570,7 @@ int soft_offline_page(struct page *page, int flags) ...@@ -1570,6 +1570,7 @@ int soft_offline_page(struct page *page, int flags)
atomic_long_inc(&num_poisoned_pages); atomic_long_inc(&num_poisoned_pages);
} }
} }
unset:
unset_migratetype_isolate(page, MIGRATE_MOVABLE); unset_migratetype_isolate(page, MIGRATE_MOVABLE);
return ret; return ret;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册