@@ -493,21 +493,20 @@ static int __net_init fib6_rules_net_init(struct net *net)
goto out;
}
-static void __net_exit fib6_rules_net_exit_batch(struct list_head *net_list)
+static void __net_exit fib6_rules_exit_batch_rtnl(struct list_head *net_list,
+ struct list_head *dev_to_kill)
{
struct net *net;
- rtnl_lock();
list_for_each_entry(net, net_list, exit_list) {
fib_rules_unregister(net->ipv6.fib6_rules_ops);
cond_resched();
}
- rtnl_unlock();
}
static struct pernet_operations fib6_rules_net_ops = {
.init = fib6_rules_net_init,
- .exit_batch = fib6_rules_net_exit_batch,
+ .exit_batch_rtnl = fib6_rules_exit_batch_rtnl,
};
int __init fib6_rules_init(void)
Using exit_batch_rtnl method instead of exit_batch avoids one rtnl_lock()/rtnl_unlock() pair in netns dismantle. Signed-off-by: Eric Dumazet <edumazet@google.com> --- net/ipv6/fib6_rules.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-)