aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/bonding
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/bonding')
-rw-r--r--drivers/net/bonding/bond_alb.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/drivers/net/bonding/bond_alb.c b/drivers/net/bonding/bond_alb.c
index 6db5d763f6b6..25b8dbf6cfd7 100644
--- a/drivers/net/bonding/bond_alb.c
+++ b/drivers/net/bonding/bond_alb.c
@@ -1455,16 +1455,16 @@ void bond_alb_monitor(struct work_struct *work)
1455 1455
1456 /* handle rlb stuff */ 1456 /* handle rlb stuff */
1457 if (bond_info->rlb_enabled) { 1457 if (bond_info->rlb_enabled) {
1458 /* the following code changes the promiscuity of the
1459 * the curr_active_slave. It needs to be locked with a
1460 * write lock to protect from other code that also
1461 * sets the promiscuity.
1462 */
1463 write_lock_bh(&bond->curr_slave_lock);
1464
1465 if (bond_info->primary_is_promisc && 1458 if (bond_info->primary_is_promisc &&
1466 (++bond_info->rlb_promisc_timeout_counter >= RLB_PROMISC_TIMEOUT)) { 1459 (++bond_info->rlb_promisc_timeout_counter >= RLB_PROMISC_TIMEOUT)) {
1467 1460
1461 /*
1462 * dev_set_promiscuity requires rtnl and
1463 * nothing else.
1464 */
1465 read_unlock(&bond->lock);
1466 rtnl_lock();
1467
1468 bond_info->rlb_promisc_timeout_counter = 0; 1468 bond_info->rlb_promisc_timeout_counter = 0;
1469 1469
1470 /* If the primary was set to promiscuous mode 1470 /* If the primary was set to promiscuous mode
@@ -1473,9 +1473,10 @@ void bond_alb_monitor(struct work_struct *work)
1473 */ 1473 */
1474 dev_set_promiscuity(bond->curr_active_slave->dev, -1); 1474 dev_set_promiscuity(bond->curr_active_slave->dev, -1);
1475 bond_info->primary_is_promisc = 0; 1475 bond_info->primary_is_promisc = 0;
1476 }
1477 1476
1478 write_unlock_bh(&bond->curr_slave_lock); 1477 rtnl_unlock();
1478 read_lock(&bond->lock);
1479 }
1479 1480
1480 if (bond_info->rlb_rebalance) { 1481 if (bond_info->rlb_rebalance) {
1481 bond_info->rlb_rebalance = 0; 1482 bond_info->rlb_rebalance = 0;