• D
    bonding: remove the no effect lock for bond_select_active_slave() · b2e7aceb
    dingtianhong 提交于
    The bond slave list was no longer protected by bond lock and only
    protected by RTNL or RCU, so anywhere that use bond lock to protect
    slave list is meaningless.
    
    remove the release and acquire bond lock for bond_select_active_slave().
    
    The curr_active_slave could only be changed in 3 place:
    
    1. enslave slave.
    2. release slave.
    3. change_active_slave.
    
    all above place were holding bond lock, RTNL and curr_slave_lock
    together, it is tedious and meaningless, obviously bond lock is no
    need here, but RTNL or curr_slave_lock is needed, so if you want
    to access active slave, you have to choose one lock, RTNL or
    curr_slave_lock, if RTNL is exist, no need to add curr_slave_lock,
    otherwise curr_slave_lock is better, because of the performance.
    
    there are several place calling bond_select_active_slave() and
    bond_change_active_slave(), the next step I will clean these place
    and remove the no effect lock.
    
    there are some document changed together when update the function.
    Suggested-by: NJay Vosburgh <fubar@us.ibm.com>
    Suggested-by: NVeaceslav Falico <vfalico@redhat.com>
    Signed-off-by: NDing Tianhong <dingtianhong@huawei.com>
    Signed-off-by: NDavid S. Miller <davem@davemloft.net>
    b2e7aceb
bond_alb.c 47.8 KB