Skip to content

Commit

Permalink
bonding: Fix locking in 802.3ad mode
Browse files Browse the repository at this point in the history
	The 802.3ad state machine lock can be acquired in both softirq and
not softirq context, but was not held at _bh to prevent a deadlock (which
could occur if a LACPDU arrived and was processed while the lock was
held).

	Corrected this, now hold the state machine lock at _bh to prevent
deadlock.

	Bug reported by Todd Fleisher <todd@fleish.org>.

Signed-off-by: Jay Vosburgh <fubar@us.ibm.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
  • Loading branch information
Jay Vosburgh authored and Jeff Garzik committed Mar 26, 2008
1 parent 26c080b commit 2bf86b7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/net/bonding/bond_3ad.c
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ static inline int __check_agg_selection_timer(struct port *port)
*/
static inline void __get_rx_machine_lock(struct port *port)
{
spin_lock(&(SLAVE_AD_INFO(port->slave).rx_machine_lock));
spin_lock_bh(&(SLAVE_AD_INFO(port->slave).rx_machine_lock));
}

/**
Expand All @@ -320,7 +320,7 @@ static inline void __get_rx_machine_lock(struct port *port)
*/
static inline void __release_rx_machine_lock(struct port *port)
{
spin_unlock(&(SLAVE_AD_INFO(port->slave).rx_machine_lock));
spin_unlock_bh(&(SLAVE_AD_INFO(port->slave).rx_machine_lock));
}

/**
Expand Down

0 comments on commit 2bf86b7

Please sign in to comment.