Skip to content

Commit

Permalink
io_uring: fail poll arm on queue proc failure
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
axboe committed Aug 12, 2020
1 parent 6d816e0 commit a36da65
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fs/io_uring.c
Original file line number Diff line number Diff line change
Expand Up @@ -4883,7 +4883,7 @@ static bool io_arm_poll_handler(struct io_kiocb *req)

ret = __io_arm_poll_handler(req, &apoll->poll, &ipt, mask,
io_async_wake);
if (ret) {
if (ret || ipt.error) {
io_poll_remove_double(req, apoll->double_poll);
spin_unlock_irq(&ctx->completion_lock);
kfree(apoll->double_poll);
Expand Down

0 comments on commit a36da65

Please sign in to comment.