Merge branch 'writeback-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git...
[cascardo/linux.git] / drivers / net / bonding / bond_alb.c
index d4fbd2e..106b88a 100644 (file)
@@ -1343,10 +1343,6 @@ void bond_alb_monitor(struct work_struct *work)
 
        read_lock(&bond->lock);
 
-       if (bond->kill_timers) {
-               goto out;
-       }
-
        if (bond->slave_cnt == 0) {
                bond_info->tx_rebalance_counter = 0;
                bond_info->lp_counter = 0;
@@ -1401,10 +1397,13 @@ void bond_alb_monitor(struct work_struct *work)
 
                        /*
                         * dev_set_promiscuity requires rtnl and
-                        * nothing else.
+                        * nothing else.  Avoid race with bond_close.
                         */
                        read_unlock(&bond->lock);
-                       rtnl_lock();
+                       if (!rtnl_trylock()) {
+                               read_lock(&bond->lock);
+                               goto re_arm;
+                       }
 
                        bond_info->rlb_promisc_timeout_counter = 0;
 
@@ -1440,9 +1439,8 @@ void bond_alb_monitor(struct work_struct *work)
        }
 
 re_arm:
-       if (!bond->kill_timers)
-               queue_delayed_work(bond->wq, &bond->alb_work, alb_delta_in_ticks);
-out:
+       queue_delayed_work(bond->wq, &bond->alb_work, alb_delta_in_ticks);
+
        read_unlock(&bond->lock);
 }