diff options
author | Nikolay Aleksandrov <nikolay@redhat.com> | 2014-09-09 23:16:58 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2014-09-09 17:31:35 -0700 |
commit | bdbc5f13036c13ba47dad5f99645556fc40381f0 (patch) | |
tree | 60a9fb60ce94cd8b16212c5d45f0d69873f7c3bc /drivers/net/bonding/bond_main.c | |
parent | 51752afa735ab28b6023fcf22ec63955107f8a65 (diff) |
bonding: 3ad: use curr_slave_lock instead of bond->lock
In 3ad mode the only syncing needed by bond->lock is for the wq
and the recv handler, so change them to use curr_slave_lock.
There're no locking dependencies here as 3ad doesn't use
curr_slave_lock at all.
Signed-off-by: Nikolay Aleksandrov <nikolay@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/bonding/bond_main.c')
-rw-r--r-- | drivers/net/bonding/bond_main.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c index f0f5eab0fab..dcd331bd0c1 100644 --- a/drivers/net/bonding/bond_main.c +++ b/drivers/net/bonding/bond_main.c @@ -1687,13 +1687,15 @@ static int __bond_release_one(struct net_device *bond_dev, * for this slave anymore. */ netdev_rx_handler_unregister(slave_dev); - write_lock_bh(&bond->lock); - /* Inform AD package of unbinding of slave. */ - if (BOND_MODE(bond) == BOND_MODE_8023AD) + if (BOND_MODE(bond) == BOND_MODE_8023AD) { + /* Sync against bond_3ad_rx_indication and + * bond_3ad_state_machine_handler + */ + write_lock_bh(&bond->curr_slave_lock); bond_3ad_unbind_slave(slave); - - write_unlock_bh(&bond->lock); + write_unlock_bh(&bond->curr_slave_lock); + } netdev_info(bond_dev, "Releasing %s interface %s\n", bond_is_active_slave(slave) ? "active" : "backup", |