Re: [patch V3 58/64] futex: Clarify comment in futex_requeue()

Davidlohr Bueso
2021-08-08T18:43:31Z

On Thu, 05 Aug 2021, Thomas Gleixner wrote:

>From: Thomas Gleixner <tglx@linutronix.de>
>
>The comment about the restriction of the number of waiters to wake for the
>REQUEUE_PI case is confusing at best. Rewrite it.

This certainly reads better.

>
>Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
>---
> kernel/futex.c | 28 ++++++++++++++++++++--------
> 1 file changed, 20 insertions(+), 8 deletions(-)
>---
>--- a/kernel/futex.c
>+++ b/kernel/futex.c
>@@ -1960,15 +1960,27 @@ static int futex_requeue(u32 __user *uad
> */
> if (refill_pi_state_cache())
> return -ENOMEM;

Perhaps this can be moved after the nr_wake check below? No sense
in calling refill_pi_state_cache() if the user is passing bogus
parameters.

> if (nr_wake != 1)
> return -EINVAL;
>

Thanks,
Davidlohr