diff options
author | Naoya Horiguchi <n-horiguchi@ah.jp.nec.com> | 2013-09-11 17:22:49 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-09-11 18:58:08 -0400 |
commit | 0d6fdbdb2a651f0c9bb979e1d92b1e15dadffc4f (patch) | |
tree | 821dd8299770976d4d4d049bb527a2c85d6e730e /mm/memory-failure.c | |
parent | cf6fe945389e674130dc7564392930cf7fb9f5e8 (diff) |
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: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>
Reviewed-by: Wanpeng 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: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm/memory-failure.c')
-rw-r--r-- | mm/memory-failure.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/mm/memory-failure.c b/mm/memory-failure.c index e05ed31c0f61..c8cc57ed7dcd 100644 --- a/mm/memory-failure.c +++ b/mm/memory-failure.c | |||
@@ -1553,7 +1553,7 @@ int soft_offline_page(struct page *page, int flags) | |||
1553 | 1553 | ||
1554 | ret = get_any_page(page, pfn, flags); | 1554 | ret = get_any_page(page, pfn, flags); |
1555 | if (ret < 0) | 1555 | if (ret < 0) |
1556 | return ret; | 1556 | goto unset; |
1557 | if (ret) { /* for in-use pages */ | 1557 | if (ret) { /* for in-use pages */ |
1558 | if (PageHuge(page)) | 1558 | if (PageHuge(page)) |
1559 | ret = soft_offline_huge_page(page, flags); | 1559 | ret = soft_offline_huge_page(page, flags); |
@@ -1570,6 +1570,7 @@ int soft_offline_page(struct page *page, int flags) | |||
1570 | atomic_long_inc(&num_poisoned_pages); | 1570 | atomic_long_inc(&num_poisoned_pages); |
1571 | } | 1571 | } |
1572 | } | 1572 | } |
1573 | unset: | ||
1573 | unset_migratetype_isolate(page, MIGRATE_MOVABLE); | 1574 | unset_migratetype_isolate(page, MIGRATE_MOVABLE); |
1574 | return ret; | 1575 | return ret; |
1575 | } | 1576 | } |