summaryrefslogtreecommitdiffstats
path: root/kernel/fork.c
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2006-07-03 09:25:15 +0200
committerLinus Torvalds <torvalds@g5.osdl.org>2006-07-04 00:27:08 +0200
commitad33945175bed649ca5fe0881269db005bbb449a (patch)
tree2aac47ea54ac59f33e8188e25e1e9d9807eecae7 /kernel/fork.c
parent[PATCH] lockdep: annotate ieee1394 skb-queue-head locking (diff)
downloadlinux-ad33945175bed649ca5fe0881269db005bbb449a.tar.xz
linux-ad33945175bed649ca5fe0881269db005bbb449a.zip
[PATCH] lockdep: annotate ->mmap_sem
Teach special (recursive) locking code to the lock validator. Has no effect on non-lockdep kernels. Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Arjan van de Ven <arjan@linux.intel.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'kernel/fork.c')
-rw-r--r--kernel/fork.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/kernel/fork.c b/kernel/fork.c
index 7f48abdd7bb6..54953d8a6f17 100644
--- a/kernel/fork.c
+++ b/kernel/fork.c
@@ -193,7 +193,10 @@ static inline int dup_mmap(struct mm_struct *mm, struct mm_struct *oldmm)
down_write(&oldmm->mmap_sem);
flush_cache_mm(oldmm);
- down_write(&mm->mmap_sem);
+ /*
+ * Not linked in yet - no deadlock potential:
+ */
+ down_write_nested(&mm->mmap_sem, SINGLE_DEPTH_NESTING);
mm->locked_vm = 0;
mm->mmap = NULL;