aboutsummaryrefslogtreecommitdiffstats
path: root/ipc/shm.c
diff options
context:
space:
mode:
authorVasiliy Kulikov <segoon@openwall.com>2011-08-03 14:26:55 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2011-08-03 20:45:55 -0400
commit33a30ed4bdccd95ed84a1a20c1fef8ac89788ce5 (patch)
treeaa57f9f5b958cf90ab548fc4535b9fb750489829 /ipc/shm.c
parent206506ccf04b6790d11553a0c8595d1bf65790fe (diff)
shm: fix wrong tests
Commit 4c677e2eefdb ("shm: optimize locking and ipc_namespace getting") introduced a copy-paste bug. Due to the bug cycle optimizations were disabled. Signed-off-by: Vasiliy Kulikov <segoon@openwall.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'ipc/shm.c')
-rw-r--r--ipc/shm.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/ipc/shm.c b/ipc/shm.c
index 9fb044f3b345..7efff043ffbf 100644
--- a/ipc/shm.c
+++ b/ipc/shm.c
@@ -294,7 +294,7 @@ static int shm_try_destroy_orphaned(int id, void *p, void *data)
294void shm_destroy_orphaned(struct ipc_namespace *ns) 294void shm_destroy_orphaned(struct ipc_namespace *ns)
295{ 295{
296 down_write(&shm_ids(ns).rw_mutex); 296 down_write(&shm_ids(ns).rw_mutex);
297 if (&shm_ids(ns).in_use) 297 if (shm_ids(ns).in_use)
298 idr_for_each(&shm_ids(ns).ipcs_idr, &shm_try_destroy_orphaned, ns); 298 idr_for_each(&shm_ids(ns).ipcs_idr, &shm_try_destroy_orphaned, ns);
299 up_write(&shm_ids(ns).rw_mutex); 299 up_write(&shm_ids(ns).rw_mutex);
300} 300}
@@ -306,7 +306,7 @@ void exit_shm(struct task_struct *task)
306 306
307 /* Destroy all already created segments, but not mapped yet */ 307 /* Destroy all already created segments, but not mapped yet */
308 down_write(&shm_ids(ns).rw_mutex); 308 down_write(&shm_ids(ns).rw_mutex);
309 if (&shm_ids(ns).in_use) 309 if (shm_ids(ns).in_use)
310 idr_for_each(&shm_ids(ns).ipcs_idr, &shm_try_destroy_current, ns); 310 idr_for_each(&shm_ids(ns).ipcs_idr, &shm_try_destroy_current, ns);
311 up_write(&shm_ids(ns).rw_mutex); 311 up_write(&shm_ids(ns).rw_mutex);
312} 312}