[Devel] [PATCH rh7] venet: Don't kill venet0 on the node

Cyrill Gorcunov gorcunov at odin.com
Fri May 1 02:03:32 PDT 2015


In case if there were new net-namespace created on the node,
upon its exit we clean up the venet0 host device occasionally.
Fix it testing if net is really ours one.

For some reason such test is already present on pcs6 so
I presume we missed to merge it in first place.

https://jira.sw.ru/browse/PSBM-33281

Signed-off-by: Cyrill Gorcunov <gorcunov at odin.com>
CC: Vladimir Davydov <vdavydov at odin.com>
CC: Konstantin Khorenko <khorenko at odin.com>
CC: Andrey Vagin <avagin at odin.com>
---
 drivers/net/venetdev.c |    4 ++++
 1 file changed, 4 insertions(+)

Index: linux-pcs7.git/drivers/net/venetdev.c
===================================================================
--- linux-pcs7.git.orig/drivers/net/venetdev.c
+++ linux-pcs7.git/drivers/net/venetdev.c
@@ -1122,6 +1122,8 @@ static __net_exit void venet_exit_net(st
 
 	list_for_each_entry(net, net_exit_list, exit_list) {
 		env = net->owner_ve;
+		if (env->ve_netns != net)
+			continue;
 
 		venet_ext_clean(env);
 		veip_stop(env);
@@ -1141,6 +1143,8 @@ static __net_exit void venet_exit_net(st
 
 	list_for_each_entry(net, net_exit_list, exit_list) {
 		env = net->owner_ve;
+		if (env->ve_netns != net)
+			continue;
 
 		dev = env->_venet_dev;
 		if (dev == NULL)



More information about the Devel mailing list