]> git.kernelconcepts.de Git - karo-tx-linux.git/blobdiff - ipc/shm.c
ipc: move rcu lock out of ipc_addid
[karo-tx-linux.git] / ipc / shm.c
index 85dc001634b1bb6cb63604f79178205504f73aca..bd2b14ef1bba6924ba35a9480a1a269a20ef275c 100644 (file)
--- a/ipc/shm.c
+++ b/ipc/shm.c
@@ -535,6 +535,7 @@ static int newseg(struct ipc_namespace *ns, struct ipc_params *params)
        shp->shm_nattch = 0;
        shp->shm_file = file;
        shp->shm_creator = current;
+
        /*
         * shmid gets reported as "inode#" in /proc/pid/maps.
         * proc-ps tools use this. Changing this will break them.
@@ -543,7 +544,9 @@ static int newseg(struct ipc_namespace *ns, struct ipc_params *params)
 
        ns->shm_tot += numpages;
        error = shp->shm_perm.id;
-       shm_unlock(shp);
+
+       spin_unlock(&shp->shm_perm.lock);
+       rcu_read_unlock();
        return error;
 
 no_id: