Re: [PATCH] sysctl: Add a group of macro functions to initcall the sysctl table of each feature

From: Luis Chamberlain
Date: Mon Dec 13 2021 - 16:29:39 EST


On Mon, Dec 13, 2021 at 10:04:48AM -0600, Eric W. Biederman wrote:
> If you look at __register_sysctl_table the core registration function
> you will see that all directory entries get reduced to simply a path
> component. So they have nothing but their names as input into
> the sysctl subsystem.
>
> Further __register_sysctl_table goes in a loop through the path
> and does get_subdir to find or create the directory.
>
> Which means that if two places were to register sysctls in
> the "fs" directory they would both use the safe "fs" directory
> and whoever can first would create it.
>
> Which should mean that worrying about ordering is completely
> unnecessary.
>
> What am I missing?

I was being too cautious, sorry for not having dug enough.
Then this makes things much easier. Thanks!

Luis