summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--mm/memory-failure.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/mm/memory-failure.c b/mm/memory-failure.c
index f66977a17196..e659a7ef5acf 100644
--- a/mm/memory-failure.c
+++ b/mm/memory-failure.c
@@ -1690,6 +1690,19 @@ try_again:
if (PageTransHuge(hpage)) {
/*
+ * Bail out before SetPageHasHWPoisoned() if hpage is
+ * huge_zero_page, although PG_has_hwpoisoned is not
+ * checked in set_huge_zero_page().
+ *
+ * TODO: Handle memory failure of huge_zero_page thoroughly.
+ */
+ if (is_huge_zero_page(hpage)) {
+ action_result(pfn, MF_MSG_UNSPLIT_THP, MF_IGNORED);
+ res = -EBUSY;
+ goto unlock_mutex;
+ }
+
+ /*
* The flag must be set after the refcount is bumped
* otherwise it may race with THP split.
* And the flag can't be set in get_hwpoison_page() since