Skip to content

Commit

Permalink
[BRIDGE]: Fix deadlock in br_stp_disable_bridge
Browse files Browse the repository at this point in the history
Looks like somebody forgot to use the _bh spin_lock variant. We ran into a 
deadlock where br->hello_timer expired while br_stp_disable_br() walked 
br->port_list. 

Signed-off-by: Adrian Drzewiecki <z@drze.net>
Signed-off-by: Stephen Hemminger <shemminger@osdl.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Adrian Drzewiecki authored and David S. Miller committed Feb 15, 2006
1 parent ee68cea commit 78872cc
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions net/bridge/br_stp_if.c
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ void br_stp_disable_bridge(struct net_bridge *br)
{
struct net_bridge_port *p;

spin_lock(&br->lock);
spin_lock_bh(&br->lock);
list_for_each_entry(p, &br->port_list, list) {
if (p->state != BR_STATE_DISABLED)
br_stp_disable_port(p);
Expand All @@ -76,7 +76,7 @@ void br_stp_disable_bridge(struct net_bridge *br)

br->topology_change = 0;
br->topology_change_detected = 0;
spin_unlock(&br->lock);
spin_unlock_bh(&br->lock);

del_timer_sync(&br->hello_timer);
del_timer_sync(&br->topology_change_timer);
Expand Down

0 comments on commit 78872cc

Please sign in to comment.