*/
 void bond_3ad_update_lacp_rate(struct bonding *bond)
 {
-       struct slave *slave;
        struct port *port = NULL;
+       struct slave *slave;
        int lacp_fast;
 
-       write_lock_bh(&bond->lock);
        lacp_fast = bond->params.lacp_fast;
-
        bond_for_each_slave(bond, slave) {
                port = &(SLAVE_AD_INFO(slave).port);
-               if (port->slave == NULL)
-                       continue;
                __get_state_machine_lock(port);
                if (lacp_fast)
                        port->actor_oper_port_state |= AD_STATE_LACP_TIMEOUT;
                        port->actor_oper_port_state &= ~AD_STATE_LACP_TIMEOUT;
                __release_state_machine_lock(port);
        }
-
-       write_unlock_bh(&bond->lock);
 }
 
                                  struct device_attribute *attr,
                                  const char *buf, size_t count)
 {
-       int new_value, ret = count;
        struct bonding *bond = to_bond(d);
+       int new_value, ret = count;
+
+       if (!rtnl_trylock())
+               return restart_syscall();
 
        if (bond->dev->flags & IFF_UP) {
                pr_err("%s: Unable to update LACP rate because interface is up.\n",
                ret = -EINVAL;
        }
 out:
+       rtnl_unlock();
+
        return ret;
 }
 static DEVICE_ATTR(lacp_rate, S_IRUGO | S_IWUSR,