Re: [PATCH v3 06/15] futex: FLAGS_STRICT

From: Thomas Gleixner
Date: Thu Sep 21 2023 - 15:03:41 EST


On Thu, Sep 21 2023 at 12:45, peterz@xxxxxxxxxxxxx wrote:
> The current semantics for futex_wake() are a bit loose, specifically
> asking for 0 futexes to be woken actually gets you 1.
>
> Adding a !nr check to sys_futex_wake() makes that it would return 0
> for unaligned futex words, because that check comes in the shared
> futex_wake() function. Adding the !nr check there, would affect the
> legacy sys_futex() semantics.
>
> Hence frob a flag :-(
>
> Suggested-by: André Almeida <andrealmeid@xxxxxxxxxx>
> Signed-off-by: Peter Zijlstra (Intel) <peterz@xxxxxxxxxxxxx>

Reviewed-by: Thomas Gleixner <tglx@xxxxxxxxxxxxx>