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>
                }
        }
        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;
 }
 {
        
        __unregister_pernet_operations(ops);
+       rcu_barrier();
        if (ops->id)
                ida_remove(&net_generic_ids, *ops->id);
 }