[PATCH] kdump: Give crashkernel CMA areas unique names

Jiri Bohac jbohac at suse.cz
Fri Nov 6 06:13:50 PST 2026


On Fri, Nov 06, 2026 at 11:43:09AM +0100, Mikhail Zaslonko wrote:
> reserve_crashkernel_cma() names every CMA area it reserves
> "crashkernel". If the requested size can't be reserved in one piece,
> it falls back to several smaller areas, all with the same name.
> With CONFIG_CMA_SYSFS, cma_sysfs_init() then fails to create the second
> directory:
> 
>   sysfs: cannot create duplicate filename '/kernel/mm/cma/crashkernel'
> 
> and the error path removes the sysfs entries of all CMA areas.
> 
> With CONFIG_CMA_DEBUGFS, debugfs refuses the duplicate directories as
> well:
> 
>   debugfs: 'crashkernel' already exists in 'cma'
> 
> so only the first area shows up in debugfs.
> 
> Keep the name of the first area and add the index to the others:
> crashkernel, crashkernel1, crashkernel2, ...
> 
> Fixes: ab475510e042 ("kdump: implement reserve_crashkernel_cma")
> Signed-off-by: Mikhail Zaslonko <zaslonko at linux.ibm.com>

Thanks for fixing this.

I don't think we really need the special case for crashk_cma_cnt == 0 
and that "crashkernel0" would be fine. But I don't mind either way.

Acked-by: Jiri Bohac <jbohac at suse.cz>

-- 
Jiri Bohac <jbohac at suse.cz>
SUSE Labs, Prague, Czechia




More information about the kexec mailing list