[PATCH] bonding fix

Linux Kernel Mailing List <[email protected]> Thu, 31 Mar 2005 01:39:15 +0000
Newsgroups gmane.linux.kernel.commits.2-4
Message-ID <[email protected]>
ChangeSet 1.1448.131.2, 2005/03/30 20:39:15-05:00, [email protected]

	[PATCH] bonding fix
	
	It fixes a stack dump when unloading the bonding module in 802.3ad mode
	if spinlock debugging is turned on, and it was already merged in 2.6.
	
	Signed-off-by: Jeff Garzik <[email protected]>



 bond_main.c |   15 +++++++++++----
 1 files changed, 11 insertions(+), 4 deletions(-)


diff -Nru a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
--- a/drivers/net/bonding/bond_main.c	2005-04-30 12:15:51 -07:00
+++ b/drivers/net/bonding/bond_main.c	2005-04-30 12:15:51 -07:00
@@ -469,6 +469,13 @@
  *	  * Add support for VLAN hardware acceleration capable slaves.
  *	  * Add capability to tag self generated packets in ALB/TLB modes.
  *	  Set version to 2.6.0.
+ * 2004/10/29 - Mitch Williams <mitch.a.williams at intel dot com>
+ *	- Fixed bug when unloading module while using 802.3ad.  If
+ *	  spinlock debugging is turned on, this causes a stack dump.
+ *	  Solution is to move call to dev_remove_pack outside of the
+ *	  spinlock.
+ *	  Set version to 2.6.1.
+ *
  */
 
 //#define BONDING_DEBUG 1
@@ -3565,14 +3572,14 @@
 {
 	struct bonding *bond = bond_dev->priv;
 
-	write_lock_bh(&bond->lock);
-
-	bond_mc_list_destroy(bond);
-
 	if (bond->params.mode == BOND_MODE_8023AD) {
 		/* Unregister the receive of LACPDUs */
 		bond_unregister_lacpdu(bond);
 	}
+
+	write_lock_bh(&bond->lock);
+
+	bond_mc_list_destroy(bond);
 
 	/* signal timers not to re-arm */
 	bond->kill_timers = 1;