struct port *port;
bool should_notify_rtnl = BOND_SLAVE_NOTIFY_LATER;
- read_lock(&bond->lock);
+ read_lock(&bond->curr_slave_lock);
rcu_read_lock();
/* check if there are any slaves */
}
}
rcu_read_unlock();
- read_unlock(&bond->lock);
+ read_unlock(&bond->curr_slave_lock);
if (should_notify_rtnl && rtnl_trylock()) {
bond_slave_state_notify(bond);
return 0;
}
-/* Wrapper used to hold bond->lock so no slave manipulation can occur */
int bond_3ad_get_active_agg_info(struct bonding *bond, struct ad_info *ad_info)
{
int ret;
if (!lacpdu)
return ret;
- read_lock(&bond->lock);
+ read_lock(&bond->curr_slave_lock);
ret = bond_3ad_rx_indication(lacpdu, slave, skb->len);
- read_unlock(&bond->lock);
+ read_unlock(&bond->curr_slave_lock);
return ret;
}
* 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",