diff options
author | Thomas Gleixner <tglx@linutronix.de> | 2015-11-06 18:51:03 +0100 |
---|---|---|
committer | Steven Rostedt <rostedt@goodmis.org> | 2016-06-24 16:33:02 -0400 |
commit | 173a4b2c70898f8e9eee339508ba759de98cf197 (patch) | |
tree | b84e2242a3101db979209ae8a5ae0498adf9d30e | |
parent | 28f39fdc0257220fa221b9f0f586a094def8e6be (diff) | |
download | linux-rt-173a4b2c70898f8e9eee339508ba759de98cf197.tar.gz |
rtmutex: Handle non enqueued waiters gracefully
Yimin debugged that in case of a PI wakeup in progress when
rt_mutex_start_proxy_lock() calls task_blocks_on_rt_mutex() the latter
returns -EAGAIN and in consequence the remove_waiter() call runs into
a BUG_ON() because there is nothing to remove.
Guard it with rt_mutex_has_waiters(). This is a quick fix which is
easy to backport. The proper fix is to have a central check in
remove_waiter() so we can call it unconditionally.
Reported-and-debugged-by: Yimin Deng <yimin11.deng@gmail.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: stable-rt@vger.kernel.org
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
-rw-r--r-- | kernel/rtmutex.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/kernel/rtmutex.c b/kernel/rtmutex.c index 4cc273b85beb..d353e9191955 100644 --- a/kernel/rtmutex.c +++ b/kernel/rtmutex.c @@ -1911,7 +1911,7 @@ int rt_mutex_start_proxy_lock(struct rt_mutex *lock, ret = 0; } - if (unlikely(ret)) + if (ret && rt_mutex_has_waiters(lock)) remove_waiter(lock, waiter); raw_spin_unlock(&lock->wait_lock); |