diff options
author | Hangbin Liu <liuhangbin@gmail.com> | 2022-01-21 09:25:18 +0100 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2022-01-24 12:57:38 +0100 |
commit | aa6034678e873db8bd5c5a4b73f8b88c469374d6 (patch) | |
tree | 50bfaf343502a1188d1ac62121e1568d99b1bf2e /include/net/bonding.h | |
parent | net: sfp: ignore disabled SFP node (diff) | |
download | linux-aa6034678e873db8bd5c5a4b73f8b88c469374d6.tar.xz linux-aa6034678e873db8bd5c5a4b73f8b88c469374d6.zip |
bonding: use rcu_dereference_rtnl when get bonding active slave
bond_option_active_slave_get_rcu() should not be used in rtnl_mutex as it
use rcu_dereference(). Replace to rcu_dereference_rtnl() so we also can use
this function in rtnl protected context.
With this update, we can rmeove the rcu_read_lock/unlock in
bonding .ndo_eth_ioctl and .get_ts_info.
Reported-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Fixes: 94dd016ae538 ("bond: pass get_ts_info and SIOC[SG]HWTSTAMP ioctl to active device")
Signed-off-by: Hangbin Liu <liuhangbin@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net/bonding.h')
-rw-r--r-- | include/net/bonding.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/include/net/bonding.h b/include/net/bonding.h index f6ae3a4baea4..83cfd2d70247 100644 --- a/include/net/bonding.h +++ b/include/net/bonding.h @@ -346,7 +346,7 @@ static inline bool bond_uses_primary(struct bonding *bond) static inline struct net_device *bond_option_active_slave_get_rcu(struct bonding *bond) { - struct slave *slave = rcu_dereference(bond->curr_active_slave); + struct slave *slave = rcu_dereference_rtnl(bond->curr_active_slave); return bond_uses_primary(bond) && slave ? slave->dev : NULL; } |