* [PATCH 0/4] bonding: fixes for 2.6.25
@ 2008-03-22 5:29 Jay Vosburgh
2008-03-22 5:29 ` [PATCH 1/4] bonding: Fix locking in 802.3ad mode Jay Vosburgh
0 siblings, 1 reply; 6+ messages in thread
From: Jay Vosburgh @ 2008-03-22 5:29 UTC (permalink / raw)
To: netdev; +Cc: Jeff Garzik
Included are patches for 2.6.25, two bug fixes, a patch for a
couple of compiler warnings, and an update to the version, as
follows:
1. Fix deadlock in 802.3ad due to lack of _bh on lock. Can
deadlock if LACPDU arrives at just the wrong time.
2. Fix two compilers warnings that show up with gcc >= 4.2.
3. Fix error in sysfs cleanup during module removal
4. Bump driver version to 3.2.5.
Please apply for 2.6.25.
Thanks,
-J
---
-Jay Vosburgh, IBM Linux Technology Center, fubar@us.ibm.com
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH 1/4] bonding: Fix locking in 802.3ad mode
2008-03-22 5:29 [PATCH 0/4] bonding: fixes for 2.6.25 Jay Vosburgh
@ 2008-03-22 5:29 ` Jay Vosburgh
2008-03-22 5:29 ` [PATCH 2/4] bonding: fix two compiler warnings Jay Vosburgh
2008-03-26 3:18 ` [PATCH 1/4] bonding: Fix locking in 802.3ad mode Jeff Garzik
0 siblings, 2 replies; 6+ messages in thread
From: Jay Vosburgh @ 2008-03-22 5:29 UTC (permalink / raw)
To: netdev; +Cc: Jeff Garzik, Jay Vosburgh
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>
---
drivers/net/bonding/bond_3ad.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/bonding/bond_3ad.c b/drivers/net/bonding/bond_3ad.c
index cb3c6fa..d16e0e1 100644
--- a/drivers/net/bonding/bond_3ad.c
+++ b/drivers/net/bonding/bond_3ad.c
@@ -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));
}
/**
@@ -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));
}
/**
--
1.5.2.4
^ permalink raw reply related [flat|nested] 6+ messages in thread* [PATCH 2/4] bonding: fix two compiler warnings
2008-03-22 5:29 ` [PATCH 1/4] bonding: Fix locking in 802.3ad mode Jay Vosburgh
@ 2008-03-22 5:29 ` Jay Vosburgh
2008-03-22 5:29 ` [PATCH 3/4] bonding: Fix sysfs attribute handling Jay Vosburgh
2008-03-26 3:18 ` [PATCH 1/4] bonding: Fix locking in 802.3ad mode Jeff Garzik
1 sibling, 1 reply; 6+ messages in thread
From: Jay Vosburgh @ 2008-03-22 5:29 UTC (permalink / raw)
To: netdev; +Cc: Jeff Garzik, Jay Vosburgh, Stephen Hemminger
Fix two compiler warnings that are new with recent versions of gcc
(apparently 4.2 and up). One is fixed by refactoring; this change was
supplied by Stephen Hemminger. The other was fixed by labelling the
variable as uninitialized_var() after confirming via inspection that it
cannot actually be used uninitialized.
Signed-off-by: Jay Vosburgh <fubar@us.ibm.com>
Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
---
drivers/net/bonding/bond_alb.c | 6 +-----
drivers/net/bonding/bond_main.c | 2 +-
2 files changed, 2 insertions(+), 6 deletions(-)
diff --git a/drivers/net/bonding/bond_alb.c b/drivers/net/bonding/bond_alb.c
index b57bc94..3f58c3d 100644
--- a/drivers/net/bonding/bond_alb.c
+++ b/drivers/net/bonding/bond_alb.c
@@ -678,12 +678,8 @@ static struct slave *rlb_choose_channel(struct sk_buff *skb, struct bonding *bon
}
if (!list_empty(&bond->vlan_list)) {
- unsigned short vlan_id;
- int res = vlan_get_tag(skb, &vlan_id);
- if (!res) {
+ if (!vlan_get_tag(skb, &client_info->vlan_id))
client_info->tag = 1;
- client_info->vlan_id = vlan_id;
- }
}
if (!client_info->assigned) {
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index 0942d82..2056a87 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -383,7 +383,7 @@ struct vlan_entry *bond_next_vlan(struct bonding *bond, struct vlan_entry *curr)
*/
int bond_dev_queue_xmit(struct bonding *bond, struct sk_buff *skb, struct net_device *slave_dev)
{
- unsigned short vlan_id;
+ unsigned short uninitialized_var(vlan_id);
if (!list_empty(&bond->vlan_list) &&
!(slave_dev->features & NETIF_F_HW_VLAN_TX) &&
--
1.5.2.4
^ permalink raw reply related [flat|nested] 6+ messages in thread* [PATCH 3/4] bonding: Fix sysfs attribute handling
2008-03-22 5:29 ` [PATCH 2/4] bonding: fix two compiler warnings Jay Vosburgh
@ 2008-03-22 5:29 ` Jay Vosburgh
2008-03-22 5:29 ` [PATCH 4/4] bonding: update version Jay Vosburgh
0 siblings, 1 reply; 6+ messages in thread
From: Jay Vosburgh @ 2008-03-22 5:29 UTC (permalink / raw)
To: netdev; +Cc: Jeff Garzik, Jay Vosburgh, Libor Pechacek
From: Libor Pechacek <lpechacek@suse.cz>
For bonding interfaces any attempt to read the sysfs directory contents after
module removal results in an oops. The fix is to release sysfs attributes
for the interfaces upon module unload.
Signed-off-by: Libor Pechacek <lpechacek@suse.cz>
Acked-by: Jay Vosburgh <fubar@us.ibm.com>
--
drivers/net/bonding/bond_main.c | 3 +--
1 files changed, 1 insertions(+), 2 deletions(-)
---
drivers/net/bonding/bond_main.c | 3 +--
1 files changed, 1 insertions(+), 2 deletions(-)
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index 2056a87..0f06753 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -4528,8 +4528,7 @@ static void bond_free_all(void)
netif_tx_unlock_bh(bond_dev);
/* Release the bonded slaves */
bond_release_all(bond_dev);
- bond_deinit(bond_dev);
- unregister_netdevice(bond_dev);
+ bond_destroy(bond);
}
#ifdef CONFIG_PROC_FS
--
1.5.2.4
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH 1/4] bonding: Fix locking in 802.3ad mode
2008-03-22 5:29 ` [PATCH 1/4] bonding: Fix locking in 802.3ad mode Jay Vosburgh
2008-03-22 5:29 ` [PATCH 2/4] bonding: fix two compiler warnings Jay Vosburgh
@ 2008-03-26 3:18 ` Jeff Garzik
1 sibling, 0 replies; 6+ messages in thread
From: Jeff Garzik @ 2008-03-26 3:18 UTC (permalink / raw)
To: Jay Vosburgh; +Cc: netdev
Jay Vosburgh wrote:
> 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>
> ---
> drivers/net/bonding/bond_3ad.c | 4 ++--
> 1 files changed, 2 insertions(+), 2 deletions(-)
applied 1-4
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2008-03-26 3:18 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-03-22 5:29 [PATCH 0/4] bonding: fixes for 2.6.25 Jay Vosburgh
2008-03-22 5:29 ` [PATCH 1/4] bonding: Fix locking in 802.3ad mode Jay Vosburgh
2008-03-22 5:29 ` [PATCH 2/4] bonding: fix two compiler warnings Jay Vosburgh
2008-03-22 5:29 ` [PATCH 3/4] bonding: Fix sysfs attribute handling Jay Vosburgh
2008-03-22 5:29 ` [PATCH 4/4] bonding: update version Jay Vosburgh
2008-03-26 3:18 ` [PATCH 1/4] bonding: Fix locking in 802.3ad mode Jeff Garzik
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).