ipc: move locking out of ipcctl_pre_down_nolock
authorDavidlohr Bueso <davidlohr.bueso@hp.com>
Mon, 8 Jul 2013 23:01:12 +0000 (16:01 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 18 Oct 2013 14:45:46 +0000 (07:45 -0700)
commitac9bc6e396285ab732dd869c3edb353662134022
tree182b0be2e0238d96e02c8669e372c254d6ea81a1
parent115d40dbef93b70e6f32732b0fdd5903c1f7fce4
ipc: move locking out of ipcctl_pre_down_nolock

commit 7b4cc5d8411bd4e9d61d8714f53859740cf830c2 upstream.

This function currently acquires both the rw_mutex and the rcu lock on
successful lookups, leaving the callers to explicitly unlock them,
creating another two level locking situation.

Make the callers (including those that still use ipcctl_pre_down())
explicitly lock and unlock the rwsem and rcu lock.

Signed-off-by: Davidlohr Bueso <davidlohr.bueso@hp.com>
Cc: Andi Kleen <andi@firstfloor.org>
Cc: Rik van Riel <riel@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Mike Galbraith <efault@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
ipc/msg.c
ipc/sem.c
ipc/shm.c
ipc/util.c