linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mm/memory-failure: fix hardware poison check in unpoison_memory()
@ 2023-07-17 18:18 Sidhartha Kumar
  2023-07-17 19:00 ` Andrew Morton
                   ` (3 more replies)
  0 siblings, 4 replies; 9+ messages in thread
From: Sidhartha Kumar @ 2023-07-17 18:18 UTC (permalink / raw)
  To: linux-kernel, linux-mm
  Cc: akpm, willy, linmiaohe, naoya.horiguchi, Sidhartha Kumar, stable

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@infradead.org>
Fixes: a6fddef49eef ("mm/memory-failure: convert unpoison_memory() to folios")
Cc: stable@vger.kernel.org #v6.4
Signed-off-by: Sidhartha Kumar <sidhartha.kumar@oracle.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



^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2023-07-20  9:06 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-07-17 18:18 [PATCH] mm/memory-failure: fix hardware poison check in unpoison_memory() Sidhartha Kumar
2023-07-17 19:00 ` Andrew Morton
2023-07-18 14:25   ` Sidhartha Kumar
2023-07-17 23:21 ` Jane Chu
2023-07-18  0:14 ` Naoya Horiguchi
2023-07-18  0:39   ` Naoya Horiguchi
2023-07-18 14:30     ` Sidhartha Kumar
2023-07-18 23:59       ` Naoya Horiguchi
2023-07-20  9:06 ` Miaohe Lin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox