mirror of
https://github.com/torvalds/linux.git
synced 2026-04-18 06:44:00 -04:00
net: add dev_net_rcu() helper
dev->nd_net can change, readers should either use rcu_read_lock() or RTNL. We currently use a generic helper, dev_net() with no debugging support. We probably have many hidden bugs. Add dev_net_rcu() helper for callers using rcu_read_lock() protection. Signed-off-by: Eric Dumazet <edumazet@google.com> Reviewed-by: Kuniyuki Iwashima <kuniyu@amazon.com> Link: https://patch.msgid.link/20250205155120.1676781-2-edumazet@google.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
committed by
Jakub Kicinski
parent
3cf0a98fea
commit
482ad2a4ac
@@ -398,7 +398,7 @@ static inline struct net *read_pnet(const possible_net_t *pnet)
|
||||
#endif
|
||||
}
|
||||
|
||||
static inline struct net *read_pnet_rcu(possible_net_t *pnet)
|
||||
static inline struct net *read_pnet_rcu(const possible_net_t *pnet)
|
||||
{
|
||||
#ifdef CONFIG_NET_NS
|
||||
return rcu_dereference(pnet->net);
|
||||
|
||||
Reference in New Issue
Block a user