* [tip: locking/urgent] futex: Replace pointless printk in fixup_owner()
@ 2021-01-26 20:04 tip-bot2 for Thomas Gleixner
0 siblings, 0 replies; only message in thread
From: tip-bot2 for Thomas Gleixner @ 2021-01-26 20:04 UTC (permalink / raw)
To: linux-tip-commits
Cc: Thomas Gleixner, Peter Zijlstra (Intel), stable, x86, linux-kernel
The following commit has been merged into the locking/urgent branch of tip:
Commit-ID: 04b79c55201f02ffd675e1231d731365e335c307
Gitweb: https://git.kernel.org/tip/04b79c55201f02ffd675e1231d731365e335c307
Author: Thomas Gleixner <tglx@linutronix.de>
AuthorDate: Tue, 19 Jan 2021 16:06:10 +01:00
Committer: Thomas Gleixner <tglx@linutronix.de>
CommitterDate: Tue, 26 Jan 2021 15:10:58 +01:00
futex: Replace pointless printk in fixup_owner()
If that unexpected case of inconsistent arguments ever happens then the
futex state is left completely inconsistent and the printk is not really
helpful. Replace it with a warning and make the state consistent.
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: stable@vger.kernel.org
---
kernel/futex.c | 10 +++-------
1 file changed, 3 insertions(+), 7 deletions(-)
diff --git a/kernel/futex.c b/kernel/futex.c
index d5e61c2..5dc8f89 100644
--- a/kernel/futex.c
+++ b/kernel/futex.c
@@ -2550,14 +2550,10 @@ static int fixup_owner(u32 __user *uaddr, struct futex_q *q, int locked)
/*
* Paranoia check. If we did not take the lock, then we should not be
- * the owner of the rt_mutex.
+ * the owner of the rt_mutex. Warn and establish consistent state.
*/
- if (rt_mutex_owner(&q->pi_state->pi_mutex) == current) {
- printk(KERN_ERR "fixup_owner: ret = %d pi-mutex: %p "
- "pi-state %p\n", ret,
- q->pi_state->pi_mutex.owner,
- q->pi_state->owner);
- }
+ if (WARN_ON_ONCE(rt_mutex_owner(&q->pi_state->pi_mutex) == current))
+ return fixup_pi_state_owner(uaddr, q, current);
return 0;
}
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2021-01-27 3:18 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-26 20:04 [tip: locking/urgent] futex: Replace pointless printk in fixup_owner() tip-bot2 for Thomas Gleixner
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).