Skip to content

Commit a36da65

Browse files
committed
io_uring: fail poll arm on queue proc failure
Check the ipt.error value, it must have been either cleared to zero or set to another error than the default -EINVAL if we don't go through the waitqueue proc addition. Just give up on poll at that point and return failure, this will fallback to async work. io_poll_add() doesn't suffer from this failure case, as it returns the error value directly. Cc: [email protected] # v5.7+ Reported-by: [email protected] Reviewed-by: Stefano Garzarella <[email protected]> Signed-off-by: Jens Axboe <[email protected]>
1 parent 6d816e0 commit a36da65

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

fs/io_uring.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4883,7 +4883,7 @@ static bool io_arm_poll_handler(struct io_kiocb *req)
48834883

48844884
ret = __io_arm_poll_handler(req, &apoll->poll, &ipt, mask,
48854885
io_async_wake);
4886-
if (ret) {
4886+
if (ret || ipt.error) {
48874887
io_poll_remove_double(req, apoll->double_poll);
48884888
spin_unlock_irq(&ctx->completion_lock);
48894889
kfree(apoll->double_poll);

0 commit comments

Comments
 (0)