[BRIDGE]: Missing rtnl.
authorStephen Hemminger <shemminger@linux-foundation.org>
Thu, 26 Apr 2007 05:08:46 +0000 (22:08 -0700)
committerDavid S. Miller <davem@sunset.davemloft.net>
Thu, 26 Apr 2007 05:30:04 +0000 (22:30 -0700)
Writing to /sys/class/net/brX/bridge/stp_state causes a warning because
RTNL is not held when call br_stp_if.c

Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/bridge/br_sysfs_br.c

index 7ec0b76..33c6c4a 100644 (file)
@@ -149,9 +149,11 @@ static ssize_t show_stp_state(struct device *d,
 
 static void set_stp_state(struct net_bridge *br, unsigned long val)
 {
+       rtnl_lock();
        spin_unlock_bh(&br->lock);
        br_stp_set_enabled(br, val);
        spin_lock_bh(&br->lock);
+       rtnl_unlock();
 }
 
 static ssize_t store_stp_state(struct device *d,