Skip to content

Commit 61e28cf

Browse files
jpemartinstorvalds
authored andcommitted
memory-failure: fetch compound_head after pgmap_pfn_valid()
memory_failure_dev_pagemap() at the moment assumes base pages (e.g. dax_lock_page()). For devmap with compound pages fetch the compound_head in case a tail page memory failure is being handled. Currently this is a nop, but in the advent of compound pages in dev_pagemap it allows memory_failure_dev_pagemap() to keep working. Without this fix memory-failure handling (i.e. MCEs on pmem) with device-dax configured namespaces will regress (and crash). Link: https://lkml.kernel.org/r/[email protected] Reported-by: Jane Chu <[email protected]> Signed-off-by: Joao Martins <[email protected]> Reviewed-by: Naoya Horiguchi <[email protected]> Reviewed-by: Dan Williams <[email protected]> Reviewed-by: Muchun Song <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
1 parent dbecf9b commit 61e28cf

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

mm/memory-failure.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1595,6 +1595,12 @@ static int memory_failure_dev_pagemap(unsigned long pfn, int flags,
15951595
goto out;
15961596
}
15971597

1598+
/*
1599+
* Pages instantiated by device-dax (not filesystem-dax)
1600+
* may be compound pages.
1601+
*/
1602+
page = compound_head(page);
1603+
15981604
/*
15991605
* Prevent the inode from being freed while we are interrogating
16001606
* the address_space, typically this would be handled by

0 commit comments

Comments
 (0)