mm: soft-offline: return -EBUSY if set_hwpoison_free_buddy_page() fails
Subsystems (3)
[email protected]
maintainerPATCH 6/15 mm: soft-offline: return -EBUSY if set_hwpoison_free_buddy_page() fails
From: Naoya Horiguchi <[email protected]>
Subject: mm: soft-offline: return -EBUSY if set_hwpoison_free_buddy_page() fails
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.
Signed-off-by Naoya Horiguchi <[email protected]>
Fixes 6bc9b56433b76 ("mm: fix race on soft-offlining")
Reviewed-by Mike Kravetz <[email protected]>
Reviewed-by Oscar Salvador <[email protected]>
Cc Michal Hocko <[email protected]>
Cc Xishi Qiu <[email protected]>
Cc "Chen, Jerry T" <[email protected]>
Cc "Zhuo, Qiuxu" <[email protected]>
Cc <[email protected]> [4.19+]
Signed-off-by Andrew Morton <[email protected]>
---
mm/memory-failure.c | 2 ++ 1 file changed, 2 insertions(+)
mm/memory-failure.c renamed from mm/memory-failure.c~mm-soft-offline-return-ebusy-if-set_hwpoison_free_buddy_page-fails +2 -0
@@ -1730,6 +1730,8 @@ static int soft_offline_huge_page(structif (!ret) {if (set_hwpoison_free_buddy_page (page))num_poisoned_pages_inc (); +else + ret = -EBUSY ; } }return ret;
_