summaryrefslogtreecommitdiffstats
path: root/mm
diff options
context:
space:
mode:
authorNaoya Horiguchi2019-06-28 21:06:53 +0200
committerGreg Kroah-Hartman2019-07-03 13:14:44 +0200
commitaab629188848b6b7af2e41374dfe0b4e61cc8add (patch)
tree6263f40d74408e6af377a881642e19aa910ecd5e /mm
parentclk: socfpga: stratix10: fix divider entry for the emac clocks (diff)
downloadkernel-qcow2-linux-aab629188848b6b7af2e41374dfe0b4e61cc8add.tar.gz
kernel-qcow2-linux-aab629188848b6b7af2e41374dfe0b4e61cc8add.tar.xz
kernel-qcow2-linux-aab629188848b6b7af2e41374dfe0b4e61cc8add.zip
mm: soft-offline: return -EBUSY if set_hwpoison_free_buddy_page() fails
commit b38e5962f8ed0d2a2b28a887fc2221f7f41db119 upstream. The pass/fail of soft offline should be judged by checking whether the raw error page was finally contained or not (i.e. the result of set_hwpoison_free_buddy_page()), but current code do not work like that. It might lead us to misjudge the test result when set_hwpoison_free_buddy_page() fails. Without this fix, there are cases where madvise(MADV_SOFT_OFFLINE) may not offline the original page and will not return an error. Link: http://lkml.kernel.org/r/1560154686-18497-2-git-send-email-n-horiguchi@ah.jp.nec.com Signed-off-by: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com> Fixes: 6bc9b56433b76 ("mm: fix race on soft-offlining") Reviewed-by: Mike Kravetz <mike.kravetz@oracle.com> Reviewed-by: Oscar Salvador <osalvador@suse.de> Cc: Michal Hocko <mhocko@kernel.org> Cc: Xishi Qiu <xishi.qiuxishi@alibaba-inc.com> Cc: "Chen, Jerry T" <jerry.t.chen@intel.com> Cc: "Zhuo, Qiuxu" <qiuxu.zhuo@intel.com> Cc: <stable@vger.kernel.org> [4.19+] Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'mm')
-rw-r--r--mm/memory-failure.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/mm/memory-failure.c b/mm/memory-failure.c
index 6edc6db5ec1b..1f57d18b1385 100644
--- a/mm/memory-failure.c
+++ b/mm/memory-failure.c
@@ -1731,6 +1731,8 @@ static int soft_offline_huge_page(struct page *page, int flags)
if (!ret) {
if (set_hwpoison_free_buddy_page(page))
num_poisoned_pages_inc();
+ else
+ ret = -EBUSY;
}
}
return ret;