]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
io_uring/futex: ensure partial wakes are appropriately dequeued
authorJens Axboe <axboe@kernel.dk>
Mon, 20 Apr 2026 20:24:50 +0000 (14:24 -0600)
committerJens Axboe <axboe@kernel.dk>
Tue, 21 Apr 2026 18:19:06 +0000 (12:19 -0600)
If a FUTEX_WAITV vectored operation is only partially woken, we
should call __futex_wake_mark() on the queue to account for that.
If not, then a later wakeup will wake the same entry, rather than
the next one in line.

Fixes: 8f350194d5cfd ("io_uring: add support for vectored futex waits")
Reviewed-by: Gabriel Krisman Bertazi <krisman@suse.de>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
io_uring/futex.c

index fd503c24b42807ab21efeffc58ddc750db2199af..9cc1788ef4c62bd3e979dccf5f8e7a2d0388493b 100644 (file)
@@ -159,8 +159,10 @@ static void io_futex_wakev_fn(struct wake_q_head *wake_q, struct futex_q *q)
        struct io_kiocb *req = q->wake_data;
        struct io_futexv_data *ifd = req->async_data;
 
-       if (!io_futexv_claim(ifd))
+       if (!io_futexv_claim(ifd)) {
+               __futex_wake_mark(q);
                return;
+       }
        if (unlikely(!__futex_wake_mark(q)))
                return;