From: Eric W. Biederman Date: Thu, 3 Dec 2009 02:29:06 +0000 (+0000) Subject: netns: Add an explicit rcu_barrier to unregister_pernet_{device|subsys} X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=3a765edadb28cc736d185f67d1ba6bedcc85f4b9;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git netns: Add an explicit rcu_barrier to unregister_pernet_{device|subsys} This allows namespace exit methods to batch work that comes requires an rcu barrier using call_rcu without having to treat the unregister_pernet_operations cases specially. Signed-off-by: Eric W. Biederman Signed-off-by: David S. Miller --- diff --git a/net/core/net_namespace.c b/net/core/net_namespace.c index 4026a4cff93c..bd8c4712ea24 100644 --- a/net/core/net_namespace.c +++ b/net/core/net_namespace.c @@ -413,8 +413,11 @@ again: } } error = __register_pernet_operations(list, ops); - if (error && ops->id) - ida_remove(&net_generic_ids, *ops->id); + if (error) { + rcu_barrier(); + if (ops->id) + ida_remove(&net_generic_ids, *ops->id); + } return error; } @@ -423,6 +426,7 @@ static void unregister_pernet_operations(struct pernet_operations *ops) { __unregister_pernet_operations(ops); + rcu_barrier(); if (ops->id) ida_remove(&net_generic_ids, *ops->id); }