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 --- 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 453cac5dde67ffe969edf9d3bdafe834c05632ad..d197f9bfd6c3f6a9ce0f23782f665ed7d75c026d 100644 --- a/drivers/net/vxlan/vxlan_core.c +++ b/drivers/net/vxlan/vxlan_core.c @@ -4706,8 +4706,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; @@ -4806,9 +4812,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.970.g62bdec98f9-goog