mm/memory-failure: check the mapcount of the precise page
[platform/kernel/linux-starfive.git] / mm / memory-failure.c
index f2397a8..16e002e 100644 (file)
@@ -1571,7 +1571,7 @@ static bool hwpoison_user_mappings(struct page *p, unsigned long pfn,
         * This check implies we don't kill processes if their pages
         * are in the swap cache early. Those are always late kills.
         */
-       if (!page_mapped(hpage))
+       if (!page_mapped(p))
                return true;
 
        if (PageSwapCache(p)) {
@@ -1622,10 +1622,10 @@ static bool hwpoison_user_mappings(struct page *p, unsigned long pfn,
                try_to_unmap(folio, ttu);
        }
 
-       unmap_success = !page_mapped(hpage);
+       unmap_success = !page_mapped(p);
        if (!unmap_success)
                pr_err("%#lx: failed to unmap page (mapcount=%d)\n",
-                      pfn, page_mapcount(hpage));
+                      pfn, page_mapcount(p));
 
        /*
         * try_to_unmap() might put mlocked page in lru cache, so call