lkml.org 
[lkml]   [2021]   [Jul]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[patch 55/63] futex: Correct the number of requeued waiters for PI
From: Thomas Gleixner <tglx@linutronix.de>

The accounting is wrong when either the PI sanity check or the
requeue PI operation fails. Adjust it in the failure path.

Will be simplified in the next step.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
---
kernel/futex.c | 4 ++++
1 file changed, 4 insertions(+)
---
--- a/kernel/futex.c
+++ b/kernel/futex.c
@@ -2128,6 +2128,8 @@ static int futex_requeue(u32 __user *uad

/* Ensure we requeue to the expected futex for requeue_pi. */
if (requeue_pi && !match_futex(this->requeue_pi_key, &key2)) {
+ /* Don't account for it */
+ task_count--;
ret = -EINVAL;
break;
}
@@ -2169,6 +2171,8 @@ static int futex_requeue(u32 __user *uad
*/
this->pi_state = NULL;
put_pi_state(pi_state);
+ /* Don't account for it */
+ task_count--;
/*
* We stop queueing more waiters and let user
* space deal with the mess.
\
 
 \ /
  Last update: 2021-07-30 16:22    [W:0.601 / U:0.376 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site