projects/linux·commit ad339451

[PATCH] lockdep: annotate ->mmap_sem

ad339451 · Ingo Molnar <[email protected]> · 2006-07-03 00:25:15 -07:00

Teach special (recursive) locking code to the lock validator.  Has no effect
on non-lockdep kernels.

Signed-off-by: Ingo Molnar <[email protected]>
Signed-off-by: Arjan van de Ven <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
Commit
ad33945175bed649ca5fe0881269db005bbb449a
Parents
d3788348

Changes

1 files changed · +4 −1

FileStatusAddDelContent
kernel/fork.cmodified+4−1View file

kernel/fork.c

View file
diff --git a/kernel/fork.c b/kernel/fork.c
index 7f48abd..54953d8 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;