blob: 40c18540b6d56640d27438a264466401798ebe82 [file] [log] [blame]
From 1a0adb9869dac631ed5d45d0afed72cfce0d9d66 Mon Sep 17 00:00:00 2001
From: Jan Blunck <jblunck@suse.de>
Date: Fri, 3 Jul 2009 13:16:23 -0500
Subject: [PATCH] rt: Make rt_down_read_trylock() behave like down_read_trylock()
commit 1a0adb9869dac631ed5d45d0afed72cfce0d9d66 in tip.
This patch removes the stupid "Read locks within the self-held write
lock succeed" behaviour. This is breaking in mm_take_all_locks() since
it is quite common to ensure that a lock is taken with
BUG_ON(down_read_trylock(&mm->mmap_sem)).
Signed-off-by: Jan Blunck <jblunck@suse.de>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
diff --git a/kernel/rt.c b/kernel/rt.c
index 97709a6..d095969 100644
--- a/kernel/rt.c
+++ b/kernel/rt.c
@@ -380,18 +380,6 @@ int rt_down_read_trylock(struct rw_semaphore *rwsem)
unsigned long flags;
int ret;
- /*
- * Read locks within the self-held write lock succeed.
- */
- spin_lock_irqsave(&rwsem->lock.wait_lock, flags);
- if (rt_mutex_real_owner(&rwsem->lock) == current) {
- spin_unlock_irqrestore(&rwsem->lock.wait_lock, flags);
- rwsem_acquire_read(&rwsem->dep_map, 0, 1, _RET_IP_);
- rwsem->read_depth++;
- return 1;
- }
- spin_unlock_irqrestore(&rwsem->lock.wait_lock, flags);
-
ret = rt_mutex_trylock(&rwsem->lock);
if (ret)
rwsem_acquire(&rwsem->dep_map, 0, 1, _RET_IP_);
--
1.7.1.1