On Fri, Aug 26, 2022 at 10:18:14AM -0700, Dan Williams wrote:
> In the case where a filesystem is polled to take over the memory failure
> and receives -EOPNOTSUPP it indicates that page->index and page->mapping
> are valid for reverse mapping the failure address. Introduce
> FSDAX_INVALID_PGOFF to distinguish when add_to_kill() is being called
> from mf_dax_kill_procs() by a filesytem vs the typical memory_failure()
> path.
> 
> Otherwise, vma_pgoff_address() is called with an invalid fsdax_pgoff
> which then trips this failing signature:
> 
>  kernel BUG at mm/memory-failure.c:319!
>  invalid opcode: 0000 [#1] PREEMPT SMP PTI
>  CPU: 13 PID: 1262 Comm: dax-pmd Tainted: G           OE    N 6.0.0-rc2+ #62
>  Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 0.0.0 02/06/2015
>  RIP: 0010:add_to_kill.cold+0x19d/0x209
>  [..]
>  Call Trace:
>   <TASK>
>   collect_procs.part.0+0x2c4/0x460
>   memory_failure+0x71b/0xba0
>   ? _printk+0x58/0x73
>   do_madvise.part.0.cold+0xaf/0xc5
> 
> Fixes: c36e20249571 ("mm: introduce mf_dax_kill_procs() for fsdax case")
> Cc: Shiyang Ruan <[email protected]>
> Cc: Christoph Hellwig <[email protected]>
> Cc: Darrick J. Wong <[email protected]>
> Cc: Naoya Horiguchi <[email protected]>
> Cc: Al Viro <[email protected]>
> Cc: Dave Chinner <[email protected]>
> Cc: Goldwyn Rodrigues <[email protected]>
> Cc: Jane Chu <[email protected]>
> Cc: Matthew Wilcox <[email protected]>
> Cc: Miaohe Lin <[email protected]>
> Cc: Ritesh Harjani <[email protected]>
> Cc: Andrew Morton <[email protected]>
> Signed-off-by: Dan Williams <[email protected]>

Acked-by: Naoya Horiguchi <[email protected]>

Reply via email to