[Devel] Re: [PATCH 1/2] SYSCTL: root unregister routine introduced

Andrew Morton akpm at linux-foundation.org
Mon Dec 12 14:52:08 PST 2011


On Mon, 12 Dec 2011 21:50:00 +0300
Stanislav Kinsbursky <skinsbursky at parallels.com> wrote:

> This routine is required for SUNRPC sysctl's, which are going to be allocated,
> processed and destroyed per network namespace context.
> IOW, new sysctl root will be registered on network namespace creation and
> thus have to unregistered before network namespace destruction.
> 

It's a bit suspicious that such a mature subsystem as sysctl newly
needs its internals exported like this.  Either a) the net namespaces
work is doing something which hasn't been done before or b) it is doing
something wrong.

So, please explain further so we can confirm that it is a) and not b).

> --- a/kernel/sysctl.c
> +++ b/kernel/sysctl.c
> @@ -1701,6 +1701,13 @@ void register_sysctl_root(struct ctl_table_root *root)
>  	spin_unlock(&sysctl_lock);
>  }
>  
> +void unregister_sysctl_root(struct ctl_table_root *root)
> +{
> +	spin_lock(&sysctl_lock);
> +	list_del(&root->root_list);
> +	spin_unlock(&sysctl_lock);
> +}
> +

This requires the addition of a declaration to include/linux/sysctl.h.

Once that is done and review is complete, I'd suggest that these two
patches be joined into a single patch, and that patch become part of
whatever patch series it is which needs them.




More information about the Devel mailing list