]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - ipc/namespace.c
ipc: recompute msgmni on ipc namespace creation/removal
[linux-2.6-omap-h63xx.git] / ipc / namespace.c
index f7a35be2e7718ce72a1510fb80f301d7a7d77832..9171d948751e72c6c0c8fa1b8e60688ba4384a0c 100644 (file)
@@ -26,6 +26,12 @@ static struct ipc_namespace *clone_ipc_ns(struct ipc_namespace *old_ns)
        msg_init_ns(ns);
        shm_init_ns(ns);
 
+       /*
+        * msgmni has already been computed for the new ipc ns.
+        * Thus, do the ipcns creation notification before registering that
+        * new ipcns in the chain.
+        */
+       ipcns_notify(IPCNS_CREATED);
        register_ipcns_notifier(ns);
 
        kref_init(&ns->kref);
@@ -97,4 +103,10 @@ void free_ipc_ns(struct kref *kref)
        shm_exit_ns(ns);
        kfree(ns);
        atomic_dec(&nr_ipc_ns);
+
+       /*
+        * Do the ipcns removal notification after decrementing nr_ipc_ns in
+        * order to have a correct value when recomputing msgmni.
+        */
+       ipcns_notify(IPCNS_REMOVED);
 }