[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <871vorcrrm.wl%chamas@h4.dion.ne.jp>
Date: Wed, 08 Jul 2009 20:56:29 +0900
From: Ken-ichirou MATSUZAWA <chamas@...dion.ne.jp>
To: netdev@...r.kernel.org
Cc: chamas@...dion.ne.jp
Subject: [PATCH] don't touch bridge sysfs in container.
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
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists