Re: [PATCH] mm: unhide get_dump_page() function
From: Brian Mak
Date: Mon Feb 24 2025 - 13:43:37 EST
On Feb 24, 2025, at 7:12 AM, Arnd Bergmann <arnd@xxxxxxxxxx> wrote:
> The definition of get_dump_page() is guarded by CONFIG_ELF_CORE, but
> the caller has now moved into a function that is built based on
> CONFIG_COREDUMP, which leads to a possible link failure:
>
> ld.lld-21: error: undefined symbol: get_dump_page
>>>> referenced by coredump.c
>>>> fs/coredump.o:(dump_vma_snapshot) in archive vmlinux.a
Kernel test robot reported this issue yesterday here:
https://lore.kernel.org/oe-kbuild-all/202502231914.ROOVWMZN-lkp@xxxxxxxxx/
https://lore.kernel.org/oe-kbuild-all/202502231818.fP8cuxmf-lkp@xxxxxxxxx/
> Change the #ifdef block around the definition to match the caller.
> In practice there is very little difference, as setting COREDUMP
> but not ELF_CORE is not useful.
Good catch! I wonder if we should guard the sparse dump size calculation
logic from the get_dump_page() caller behind CONFIG_ELF_CORE instead
though. I guess the question becomes, will we ever have a non-ELF core
dump format that won't skip zero pages?
Anyway, I'm fine with this fix as-is.