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

From: Davidlohr Bueso
Date: Sun Aug 08 2021 - 14:43:42 EST


On Thu, 05 Aug 2021, Thomas Gleixner wrote:

From: Thomas Gleixner <tglx@xxxxxxxxxxxxx>

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@xxxxxxxxxxxxx>
---
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