diff options
author | Pavel Emelianov <xemul@sw.ru> | 2007-05-08 03:29:10 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-05-08 14:15:09 -0400 |
commit | 428e6ce023c5890cfecc8ad10335da3f28dbf893 (patch) | |
tree | 17c746035cf727bc5494b9116ae6034724aaede3 | |
parent | 644fd4f5de9ca147daeb6dc5f844b44ec3d58b47 (diff) |
Lockdep treats down_write_trylock like regular down_write
This causes constructions like
down_write(&mm1->mmap_sem);
if (down_write_trylock(&mm2->mmap_sem)) {
...
up_write(&mm2->mmap_sem);
}
up_write(&mm1->mmap_sem);
generate a lockdep warning about circular locking dependence.
Call rwsem_acquire() with trylock set to 1.
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Arjan van de Ven <arjan@infradead.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r-- | kernel/rwsem.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/kernel/rwsem.c b/kernel/rwsem.c index 291ded556aa0..9a87886b022e 100644 --- a/kernel/rwsem.c +++ b/kernel/rwsem.c | |||
@@ -60,7 +60,7 @@ int down_write_trylock(struct rw_semaphore *sem) | |||
60 | int ret = __down_write_trylock(sem); | 60 | int ret = __down_write_trylock(sem); |
61 | 61 | ||
62 | if (ret == 1) | 62 | if (ret == 1) |
63 | rwsem_acquire(&sem->dep_map, 0, 0, _RET_IP_); | 63 | rwsem_acquire(&sem->dep_map, 0, 1, _RET_IP_); |
64 | return ret; | 64 | return ret; |
65 | } | 65 | } |
66 | 66 | ||