[Devel] [PATCH rh7] net: Set null only for nets ve is a keeper of

Andrey Wagin avagin at gmail.com
Thu May 14 08:36:52 PDT 2015


2015-05-14 16:08 GMT+03:00 Cyrill Gorcunov <gorcunov at odin.com>:
> In venet we don't setup ve::ve_netns for nested net-namespaces
> but on net cleanups we zap them unconditionally which ruines
> further net unshares. Fix it testing if the @net we're cleaning
> up does belong us.
>
> https://jira.sw.ru/browse/PSBM-33480
>
> v2:
>  - same applies when net namespace is created inside container
>    itself: don't zap it until the net we're cleaning is the owner
> v3:
>  - make it closer to pcs6 code

Acked-by: Andrew Vagin <avagin at openvz.org>

>
> Signed-off-by: Cyrill Gorcunov <gorcunov at odin.com>
> CC: Andrew Vagin <avagin at odin.com>
> ---
>  net/core/net_namespace.c |    6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
>
> Index: linux-pcs7.git/net/core/net_namespace.c
> ===================================================================
> --- linux-pcs7.git.orig/net/core/net_namespace.c
> +++ linux-pcs7.git/net/core/net_namespace.c
> @@ -314,8 +314,10 @@ static void cleanup_net(struct work_stru
>                 ops_free_list(ops, &net_exit_list);
>
>         list_for_each_entry(net, &net_kill_list, cleanup_list) {
> -               net->owner_ve->ve_netns = NULL;
> -               put_ve(net->owner_ve);
> +               struct ve_struct *ve = net->owner_ve;
> +               if (ve->ve_netns == net)
> +                       ve->ve_netns = NULL;
> +               put_ve(ve);
>         }
>
>         mutex_unlock(&net_mutex);
> _______________________________________________
> Devel mailing list
> Devel at openvz.org
> https://lists.openvz.org/mailman/listinfo/devel



More information about the Devel mailing list