path: root/kernel/rtmutex.c
diff options
authorDarren Hart <>2009-08-05 19:05:21 (GMT)
committerIngo Molnar <>2009-08-06 03:50:21 (GMT)
commit1bbf20835c4e088667a090ce6523a0f70b62dc76 (patch)
tree91fea2bd29abf6be58c55e259d2904de303fcf3e /kernel/rtmutex.c
parent90bc1a658a53f8832ee799685703977a450e5af9 (diff)
rtmutex: Avoid deadlock in rt_mutex_start_proxy_lock()
In the event of a lock steal or owner died, rt_mutex_start_proxy_lock() will give the rt_mutex to the waiting task, but it fails to release the wait_lock. This leads to subsequent deadlocks when other tasks try to acquire the rt_mutex. I also removed a few extra blank lines that really spaced this routine out. I must have been high on the \n when I wrote this originally... Signed-off-by: Darren Hart <> Cc: Peter Zijlstra <> Cc: Steven Rostedt <> Cc: Dinakar Guniguntala <> Cc: John Stultz <> LKML-Reference: <> Signed-off-by: Ingo Molnar <>
Diffstat (limited to 'kernel/rtmutex.c')
1 files changed, 1 insertions, 3 deletions
diff --git a/kernel/rtmutex.c b/kernel/rtmutex.c
index fcd107a..29bd4ba 100644
--- a/kernel/rtmutex.c
+++ b/kernel/rtmutex.c
@@ -1039,16 +1039,14 @@ int rt_mutex_start_proxy_lock(struct rt_mutex *lock,
if (!rt_mutex_owner(lock) || try_to_steal_lock(lock, task)) {
/* We got the lock for task. */
rt_mutex_set_owner(lock, task, 0);
+ spin_unlock(&lock->wait_lock);
rt_mutex_deadlock_account_lock(lock, task);
return 1;
ret = task_blocks_on_rt_mutex(lock, waiter, task, detect_deadlock);
if (ret && !waiter->task) {
* Reset the return value. We might have