netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] don't touch bridge sysfs in container.
@ 2009-07-08 11:56 Ken-ichirou MATSUZAWA
  2009-07-08 16:33 ` Stephen Hemminger
  0 siblings, 1 reply; 5+ messages in thread
From: Ken-ichirou MATSUZAWA @ 2009-07-08 11:56 UTC (permalink / raw)
  To: netdev; +Cc: chamas

 Hello,

netns don't have own sysfs. we should not touch sysfs not on init_net?
I am sorry I've lost my own mail, titled

  kernel BUG at fs/sysfs/group.c:65!

below will only fixes this.

Signed-off-by: Ken-ichirou MATSUZAWA
---
 net/bridge/br_if.c |   15 +++++++++++----
 1 files changed, 11 insertions(+), 4 deletions(-)

diff --git a/net/bridge/br_if.c b/net/bridge/br_if.c
index 8a96672..7c080a9 100644
--- a/net/bridge/br_if.c
+++ b/net/bridge/br_if.c
@@ -164,7 +164,9 @@ static void del_br(struct net_bridge *br)
 
 	del_timer_sync(&br->gc_timer);
 
-	br_sysfs_delbr(br->dev);
+        if (dev_net(br->dev) == &init_net)
+                br_sysfs_delbr(br->dev);
+
 	unregister_netdevice(br->dev);
 }
 
@@ -283,6 +285,9 @@ int br_add_bridge(struct net *net, const char *name)
 	if (ret)
 		goto out_free;
 
+        if (dev_net(dev) != &init_net)
+                goto out;
+
 	ret = br_sysfs_addbr(dev);
 	if (ret)
 		unregister_netdevice(dev);
@@ -396,9 +401,11 @@ int br_add_if(struct net_bridge *br, struct net_device *dev)
 	if (err)
 		goto err1;
 
-	err = br_sysfs_addif(p);
-	if (err)
-		goto err2;
+        if (dev_net(br->dev) == &init_net) {
+                err = br_sysfs_addif(p);
+                if (err)
+                        goto err2;
+        }
 
 	rcu_assign_pointer(dev->br_port, p);
 	dev_disable_lro(dev);
-- 
1.5.6.5


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2009-07-11  3:59 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-07-08 11:56 [PATCH] don't touch bridge sysfs in container Ken-ichirou MATSUZAWA
2009-07-08 16:33 ` Stephen Hemminger
2009-07-09 10:41   ` Ken-ichirou MATSUZAWA
2009-07-09 21:23     ` Stephen Hemminger
2009-07-11  3:59       ` Ken-ichirou MATSUZAWA

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).