]> www.infradead.org Git - users/hch/misc.git/commit
net: fib_rules: Convert RTM_DELRULE to per-netns RTNL.
authorKuniyuki Iwashima <kuniyu@amazon.com>
Fri, 7 Feb 2025 07:25:02 +0000 (16:25 +0900)
committerJakub Kicinski <kuba@kernel.org>
Tue, 11 Feb 2025 03:08:53 +0000 (19:08 -0800)
commit88b9cfca8d7735b0e8c809241365577f07c52cb2
tree34ad280320bac8f3366e70c4b80db938180cd88b
parent1cf770da01120c0a84d53c4dddc57a62d1ca4f96
net: fib_rules: Convert RTM_DELRULE to per-netns RTNL.

fib_nl_delrule() is the doit() handler for RTM_DELRULE but also called
from vrf_newlink() in case something fails in vrf_add_fib_rules().

In the latter case, RTNL is already held and the 4th arg is true.

Let's hold per-netns RTNL in fib_delrule() if rtnl_held is false.

Now we can place ASSERT_RTNL_NET() in call_fib_rule_notifiers().

Signed-off-by: Kuniyuki Iwashima <kuniyu@amazon.com>
Reviewed-by: Eric Dumazet <edumazet@google.com>
Reviewed-by: Ido Schimmel <idosch@nvidia.com>
Tested-by: Ido Schimmel <idosch@nvidia.com>
Link: https://patch.msgid.link/20250207072502.87775-9-kuniyu@amazon.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
net/core/fib_rules.c