diff options
author | Eric W. Biederman <ebiederm@xmission.com> | 2009-12-02 21:29:06 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-12-03 15:22:03 -0500 |
commit | 3a765edadb28cc736d185f67d1ba6bedcc85f4b9 (patch) | |
tree | 79cbd70d9ef551cb75e897ddeb8e17749d0596b8 | |
parent | d79d792ef9f99cca463b6619a93e860d1c833a6e (diff) |
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 <ebiederm@xmission.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | net/core/net_namespace.c | 8 |
1 files changed, 6 insertions, 2 deletions
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: | |||
413 | } | 413 | } |
414 | } | 414 | } |
415 | error = __register_pernet_operations(list, ops); | 415 | error = __register_pernet_operations(list, ops); |
416 | if (error && ops->id) | 416 | if (error) { |
417 | ida_remove(&net_generic_ids, *ops->id); | 417 | rcu_barrier(); |
418 | if (ops->id) | ||
419 | ida_remove(&net_generic_ids, *ops->id); | ||
420 | } | ||
418 | 421 | ||
419 | return error; | 422 | return error; |
420 | } | 423 | } |
@@ -423,6 +426,7 @@ static void unregister_pernet_operations(struct pernet_operations *ops) | |||
423 | { | 426 | { |
424 | 427 | ||
425 | __unregister_pernet_operations(ops); | 428 | __unregister_pernet_operations(ops); |
429 | rcu_barrier(); | ||
426 | if (ops->id) | 430 | if (ops->id) |
427 | ida_remove(&net_generic_ids, *ops->id); | 431 | ida_remove(&net_generic_ids, *ops->id); |
428 | } | 432 | } |