Now that vxlan->cfg is RCU-protected, we can update vxlan_fill_info() to run under RCU read lock instead of relying on RTNL. This completes the transition to RTNL-less link info dumping for VXLAN. Signed-off-by: Eric Dumazet Reviewed-by: Kuniyuki Iwashima --- drivers/net/vxlan/vxlan_core.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/drivers/net/vxlan/vxlan_core.c b/drivers/net/vxlan/vxlan_core.c index 2b7da90ae2da3d0d8cc305d24d071cbc74ec2e6e..fd993a95501b02cc7891b434b258420de1ba4c21 100644 --- a/drivers/net/vxlan/vxlan_core.c +++ b/drivers/net/vxlan/vxlan_core.c @@ -4712,8 +4712,14 @@ static int vxlan_fill_info(struct sk_buff *skb, const struct net_device *dev) const struct vxlan_dev *vxlan = netdev_priv(dev); struct ifla_vxlan_port_range ports; const struct vxlan_config *cfg; + int err = 0; - cfg = rtnl_dereference(vxlan->cfg); + rcu_read_lock(); + cfg = rcu_dereference(vxlan->cfg); + if (!cfg) { + err = -ENODEV; + goto out; + } if (nla_put_u32(skb, IFLA_VXLAN_ID, be32_to_cpu(cfg->vni))) goto nla_put_failure; @@ -4812,9 +4818,12 @@ static int vxlan_fill_info(struct sk_buff *skb, const struct net_device *dev) &cfg->reserved_bits)) goto nla_put_failure; - return 0; +out: + rcu_read_unlock(); + return err; nla_put_failure: + rcu_read_unlock(); return -EMSGSIZE; } -- 2.55.0.979.g7e5102b832-goog