mlxsw: spectrum_router: Do not assume RTNL is taken during nexthop init
RTNL is going to be removed from route insertion path, so use __in_dev_get_rcu() from an RCU read-side critical section instead of __in_dev_get_rtnl() which assumes RTNL is taken. Signed-off-by: Ido Schimmel <idosch@mellanox.com> Acked-by: Jiri Pirko <jiri@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
eb833eec3b
commit
c43ef22843
|
@ -3840,10 +3840,14 @@ static int mlxsw_sp_nexthop4_init(struct mlxsw_sp *mlxsw_sp,
|
|||
if (!dev)
|
||||
return 0;
|
||||
|
||||
in_dev = __in_dev_get_rtnl(dev);
|
||||
rcu_read_lock();
|
||||
in_dev = __in_dev_get_rcu(dev);
|
||||
if (in_dev && IN_DEV_IGNORE_ROUTES_WITH_LINKDOWN(in_dev) &&
|
||||
fib_nh->fib_nh_flags & RTNH_F_LINKDOWN)
|
||||
fib_nh->fib_nh_flags & RTNH_F_LINKDOWN) {
|
||||
rcu_read_unlock();
|
||||
return 0;
|
||||
}
|
||||
rcu_read_unlock();
|
||||
|
||||
err = mlxsw_sp_nexthop4_type_init(mlxsw_sp, nh, fib_nh);
|
||||
if (err)
|
||||
|
|
Loading…
Reference in New Issue