Re: [PATCH 1/2] proc: add a helper for marking files as permanent by external consumers

From: Alexey Dobriyan
Date: Tue Apr 01 2025 - 07:19:25 EST


> static int __init proc_filesystems_init(void)
> {
> - proc_create_single("filesystems", 0, NULL, filesystems_proc_show);
> + struct proc_dir_entry *pde;
> +
> + pde = proc_create_single("filesystems", 0, NULL, filesystems_proc_show);
> + proc_make_permanent(pde);

The only function which should be used is pde_make_permanent()
so that the flag is silently turned off when the code is modular.

Code is fine as-is in this very case but when people start copying it
to real modules
they will start mark PDEs as permanent when it is not true!