The patch titled Subject: hwpoison: fix race with changing page during offlining has been added to the -mm tree. Its filename is hwpoison-fix-race-with-changing-page-during-offlining-v2.patch This patch should soon appear at http://ozlabs.org/~akpm/mmots/broken-out/hwpoison-fix-race-with-changing-page-during-offlining-v2.patch and later at http://ozlabs.org/~akpm/mmotm/broken-out/hwpoison-fix-race-with-changing-page-during-offlining-v2.patch Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/SubmitChecklist when testing your code *** The -mm tree is included into linux-next and is updated there every 3-4 working days ------------------------------------------------------ From: Andi Kleen <ak@xxxxxxxxxxxxxxx> Subject: hwpoison: fix race with changing page during offlining When a hwpoison page is locked it could change state due to parallel modifications. Check after the lock if the page is still the same compound page. Signed-off-by: Andi Kleen <ak@xxxxxxxxxxxxxxx> Acked-by: Naoya Horiguchi <n-horiguchi@xxxxxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- mm/memory-failure.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff -puN mm/memory-failure.c~hwpoison-fix-race-with-changing-page-during-offlining-v2 mm/memory-failure.c --- a/mm/memory-failure.c~hwpoison-fix-race-with-changing-page-during-offlining-v2 +++ a/mm/memory-failure.c @@ -1165,6 +1165,16 @@ int memory_failure(unsigned long pfn, in lock_page(hpage); /* + * The page could have changed compound pages during the locking. + * If this happens just bail out. + */ + if (compound_head(p) != hpage) { + action_result(pfn, "different compound page after locking", IGNORED); + res = -EBUSY; + goto out; + } + + /* * We use page flags to determine what action should be taken, but * the flags can be modified by the error containment action. One * example is an mlocked page, where PG_mlocked is cleared by _ Patches currently in -mm which might be from ak@xxxxxxxxxxxxxxx are hwpoison-fix-race-with-changing-page-during-offlining-v2.patch mm-introduce-do_shared_fault-and-drop-do_fault-fix-fix.patch do_shared_fault-check-that-mmap_sem-is-held.patch linux-next.patch -- To unsubscribe from this list: send the line "unsubscribe mm-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html