* [PATCH] Bridge: Removed unwanted check and improper usage of bridge locks
@ 2011-03-29 18:24 Sasikanth V
2011-03-31 15:36 ` Stephen Hemminger
0 siblings, 1 reply; 2+ messages in thread
From: Sasikanth V @ 2011-03-29 18:24 UTC (permalink / raw)
To: shemminger; +Cc: netdev, bridge, Sasikanth V
Signed-off-by: Sasikanth V <sasikanth.v19@gmail.com>
---
net/bridge/br_device.c | 5 ++++-
net/bridge/br_stp_if.c | 2 --
net/bridge/br_stp_timer.c | 3 ---
3 files changed, 4 insertions(+), 6 deletions(-)
diff --git a/net/bridge/br_device.c b/net/bridge/br_device.c
index 21e5901..6cc612b 100644
--- a/net/bridge/br_device.c
+++ b/net/bridge/br_device.c
@@ -80,10 +80,13 @@ static int br_dev_open(struct net_device *dev)
netif_carrier_off(dev);
- br_features_recompute(br);
netif_start_queue(dev);
+
+ spin_lock_bh(&br->lock);
+ br_features_recompute(br);
br_stp_enable_bridge(br);
br_multicast_open(br);
+ spin_unlock_bh(&br->lock);
return 0;
}
diff --git a/net/bridge/br_stp_if.c b/net/bridge/br_stp_if.c
index 5593f5a..472d8b2 100644
--- a/net/bridge/br_stp_if.c
+++ b/net/bridge/br_stp_if.c
@@ -44,7 +44,6 @@ void br_stp_enable_bridge(struct net_bridge *br)
{
struct net_bridge_port *p;
- spin_lock_bh(&br->lock);
mod_timer(&br->hello_timer, jiffies + br->hello_time);
mod_timer(&br->gc_timer, jiffies + HZ/10);
@@ -55,7 +54,6 @@ void br_stp_enable_bridge(struct net_bridge *br)
br_stp_enable_port(p);
}
- spin_unlock_bh(&br->lock);
}
/* NO locks held */
diff --git a/net/bridge/br_stp_timer.c b/net/bridge/br_stp_timer.c
index 3e96514..18244b2 100644
--- a/net/bridge/br_stp_timer.c
+++ b/net/bridge/br_stp_timer.c
@@ -65,8 +65,6 @@ static void br_message_age_timer_expired(unsigned long arg)
* check is redundant. I'm leaving it in for now, though.
*/
spin_lock(&br->lock);
- if (p->state == BR_STATE_DISABLED)
- goto unlock;
was_root = br_is_root_bridge(br);
br_become_designated_port(p);
@@ -74,7 +72,6 @@ static void br_message_age_timer_expired(unsigned long arg)
br_port_state_selection(br);
if (br_is_root_bridge(br) && !was_root)
br_become_root_bridge(br);
- unlock:
spin_unlock(&br->lock);
}
--
1.7.3.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] Bridge: Removed unwanted check and improper usage of bridge locks
2011-03-29 18:24 [PATCH] Bridge: Removed unwanted check and improper usage of bridge locks Sasikanth V
@ 2011-03-31 15:36 ` Stephen Hemminger
0 siblings, 0 replies; 2+ messages in thread
From: Stephen Hemminger @ 2011-03-31 15:36 UTC (permalink / raw)
To: Sasikanth V; +Cc: netdev, bridge
On Tue, 29 Mar 2011 23:54:32 +0530
Sasikanth V <sasikanth.v19@gmail.com> wrote:
I don't think this is needed because br_dev_open is already covered
by the netlink mutex RTNL
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2011-03-31 15:36 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-03-29 18:24 [PATCH] Bridge: Removed unwanted check and improper usage of bridge locks Sasikanth V
2011-03-31 15:36 ` Stephen Hemminger
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).