mirror of
https://github.com/torvalds/linux.git
synced 2025-12-07 20:06:24 +00:00
rtnetlink: prepare nla_put_iflink() to run under RCU
We want to be able to run rtnl_fill_ifinfo() under RCU protection instead of RTNL in the future. This patch prepares dev_get_iflink() and nla_put_iflink() to run either with RTNL or RCU held. Signed-off-by: Eric Dumazet <edumazet@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
committed by
David S. Miller
parent
5f6000aa24
commit
e353ea9ce4
@@ -145,7 +145,7 @@ static int netkit_get_iflink(const struct net_device *dev)
|
||||
rcu_read_lock();
|
||||
peer = rcu_dereference(nk->peer);
|
||||
if (peer)
|
||||
iflink = peer->ifindex;
|
||||
iflink = READ_ONCE(peer->ifindex);
|
||||
rcu_read_unlock();
|
||||
return iflink;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user