mm: memory-failure: avoid false hwpoison page mapped error info
authorMiaohe Lin <linmiaohe@huawei.com>
Thu, 27 Jul 2023 11:56:42 +0000 (19:56 +0800)
committerAndrew Morton <akpm@linux-foundation.org>
Fri, 4 Aug 2023 20:03:41 +0000 (13:03 -0700)
commitfaeb2ff2c1c5cb60ce0da193580b256c941f99ca
tree7138a3543309d14fc6a1424bc20dd9d404d4bf42
parentf29623e4a599c295cc8f518c8e4bb7848581a14d
mm: memory-failure: avoid false hwpoison page mapped error info

folio->_mapcount is overloaded in SLAB, so folio_mapped() has to be done
after folio_test_slab() is checked. Otherwise slab folio might be treated
as a mapped folio leading to false 'Someone maps the hwpoison page' error
info.

Link: https://lkml.kernel.org/r/20230727115643.639741-4-linmiaohe@huawei.com
Fixes: 230ac719c500 ("mm/hwpoison: don't try to unpoison containment-failed pages")
Signed-off-by: Miaohe Lin <linmiaohe@huawei.com>
Reviewed-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Acked-by: Naoya Horiguchi <naoya.horiguchi@nec.com>
Cc: Kefeng Wang <wangkefeng.wang@huawei.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
mm/memory-failure.c