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

Cyrill Gorcunov gorcunov at odin.com
Thu May 14 06:08:32 PDT 2015


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

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);



More information about the Devel mailing list