bonding: fix locking in bond_loadbalance_arp_mon()
authorDing Tianhong <dingtianhong@huawei.com>
Tue, 28 Jan 2014 03:48:53 +0000 (11:48 +0800)
committerDavid S. Miller <davem@davemloft.net>
Wed, 29 Jan 2014 07:48:33 +0000 (23:48 -0800)
commit6fde8f037e604e05df1529e4689041715d6d55d2
tree4cdf943fb2d475899f0a0d5a40cd4002184faff1
parent93e14b6d776e850a371fe4234a06088f210d8651
bonding: fix locking in bond_loadbalance_arp_mon()

The commit 1d3ee88ae0d605629bf369
(bonding: add netlink attributes to slave link dev)
has add rtmsg_ifinfo() in bond_set_active_slave() and
bond_set_backup_slave(), so the two function need to
called in RTNL lock, but bond_loadbalance_arp_mon()
only calling these functions in RCU, warning message
will occurs.

fix this by add a new function bond_slave_state_change(),
which will reset the slave's state after slave link check,
so remove the bond_set_xxx_slave() from the cycle and only
record the slave_state_changed, this will call the new
function to set all slaves to new state in RTNL later.

Cc: Jay Vosburgh <fubar@us.ibm.com>
Cc: Veaceslav Falico <vfalico@redhat.com>
Cc: Andy Gospodarek <andy@greyhouse.net>
Signed-off-by: Ding Tianhong <dingtianhong@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/bonding/bond_main.c
drivers/net/bonding/bonding.h