[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20230717181812.167757-1-sidhartha.kumar@oracle.com>
Date: Mon, 17 Jul 2023 11:18:12 -0700
From: Sidhartha Kumar <sidhartha.kumar@...cle.com>
To: linux-kernel@...r.kernel.org, linux-mm@...ck.org
Cc: akpm@...ux-foundation.org, willy@...radead.org,
linmiaohe@...wei.com, naoya.horiguchi@....com,
Sidhartha Kumar <sidhartha.kumar@...cle.com>,
stable@...r.kernel.org
Subject: [PATCH] mm/memory-failure: fix hardware poison check in unpoison_memory()
It was pointed out[1] that using folio_test_hwpoison() is wrong
as we need to check the indiviual page that has poison.
folio_test_hwpoison() only checks the head page so go back to using
PageHWPoison().
Reported-by: Matthew Wilcox (Oracle) <willy@...radead.org>
Fixes: a6fddef49eef ("mm/memory-failure: convert unpoison_memory() to folios")
Cc: stable@...r.kernel.org #v6.4
Signed-off-by: Sidhartha Kumar <sidhartha.kumar@...cle.com>
[1]: https://lore.kernel.org/lkml/ZLIbZygG7LqSI9xe@casper.infradead.org/
---
mm/memory-failure.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/mm/memory-failure.c b/mm/memory-failure.c
index 02b1d8f104d51..a114c8c3039cd 100644
--- a/mm/memory-failure.c
+++ b/mm/memory-failure.c
@@ -2523,7 +2523,7 @@ int unpoison_memory(unsigned long pfn)
goto unlock_mutex;
}
- if (!folio_test_hwpoison(folio)) {
+ if (!PageHWPoison(p)) {
unpoison_pr_info("Unpoison: Page was already unpoisoned %#lx\n",
pfn, &unpoison_rs);
goto unlock_mutex;
--
2.41.0
Powered by blists - more mailing lists