OSDN Git Service

net: Convert ctnetlink_net_ops
authorKirill Tkhai <ktkhai@virtuozzo.com>
Mon, 5 Mar 2018 11:32:15 +0000 (14:32 +0300)
committerDavid S. Miller <davem@davemloft.net>
Mon, 5 Mar 2018 15:48:28 +0000 (10:48 -0500)
These pernet_operations register and unregister
two conntrack notifiers, and they seem to be safe
to be executed in parallel.

General/not related to async pernet_operations JFI:
ctnetlink_net_exit_batch() actions are grouped in batch,
and this could look like there is synchronize_rcu()
is forgotten. But there is synchronize_rcu() on module
exit patch (in ctnetlink_exit()), so this batch may
be reworked as simple .exit method.

Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/netfilter/nf_conntrack_netlink.c

index dd177eb..8884d30 100644 (file)
@@ -3417,6 +3417,7 @@ static void __net_exit ctnetlink_net_exit_batch(struct list_head *net_exit_list)
 static struct pernet_operations ctnetlink_net_ops = {
        .init           = ctnetlink_net_init,
        .exit_batch     = ctnetlink_net_exit_batch,
+       .async          = true,
 };
 
 static int __init ctnetlink_init(void)