mm/memory-failure.c: fix race with changing page compound again
authorMiaohe Lin <linmiaohe@huawei.com>
Mon, 28 Feb 2022 23:01:14 +0000 (10:01 +1100)
committerStephen Rothwell <sfr@canb.auug.org.au>
Mon, 28 Feb 2022 23:01:14 +0000 (10:01 +1100)
commit73f343517b0e1044692a01d879b66c83e072a264
tree675dd49ce56e89a00b712bcaa7c6de51706315da
parentb98e944357623b6855108d9f4b53924a4ea49ceb
mm/memory-failure.c: fix race with changing page compound again

Patch series "A few fixup patches for memory failure".

This series contains a few patches to fix the race with changing page
compound page, fix potential VM_BUG_ON_PAGE and so on.  More details can
be found in the respective changelogs.

This patch (of 4):

There is a race window where we got the compound_head, the hugetlb page
could be freed to buddy, or even changed to another compound page just
before we try to get hwpoison page.  If this happens, just bail out.

Link: https://lkml.kernel.org/r/20220228140245.24552-1-linmiaohe@huawei.com
Link: https://lkml.kernel.org/r/20220228140245.24552-2-linmiaohe@huawei.com
Signed-off-by: Miaohe Lin <linmiaohe@huawei.com>
Cc: Naoya Horiguchi <naoya.horiguchi@nec.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
mm/memory-failure.c