Sophie

Sophie

distrib > Scientific%20Linux > 5x > x86_64 > by-pkgid > 27922b4260f65d317aabda37e42bbbff > files > 2488

kernel-2.6.18-238.el5.src.rpm

From: Andy Gospodarek <gospo@redhat.com>
Date: Tue, 2 Sep 2008 17:17:11 -0400
Subject: [net] bonding: fix locking in 802.3ad mode
Message-id: 20080902211710.GC16104@gospo.rdu.redhat.com
O-Subject: [RHEL5.3 PATCH] bonding: fix locking in 802.3ad mode
Bugzilla: 457300
RH-Acked-by: Neil Horman <nhorman@redhat.com>
RH-Acked-by: David Miller <davem@redhat.com>
RH-Acked-by: Thomas Graf <tgraf@redhat.com>

This is a backport of the following upstream commit:

commit 2bf86b7aa8e74bf81a9872f7b610f49b610a4649
Author: Jay Vosburgh <fubar@us.ibm.com>
Date:   Fri Mar 21 22:29:33 2008 -0700

    bonding: Fix locking in 802.3ad mode

        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.

It has been tested and resolves the issue reported in BZ 457300.

diff --git a/drivers/net/bonding/bond_3ad.c b/drivers/net/bonding/bond_3ad.c
index 49dc251..e437915 100644
--- a/drivers/net/bonding/bond_3ad.c
+++ b/drivers/net/bonding/bond_3ad.c
@@ -309,7 +309,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));
 }
 
 /**
@@ -319,7 +319,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));
 }
 
 /**