Skip to content

Commit

Permalink
io_uring: improve poll warning handling
Browse files Browse the repository at this point in the history
Don't try to complete requests if their refs are broken and we've got
a warning, it's much better to drop them and potentially leaking than
double freeing.

Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
Link: https://lore.kernel.org/r/31edf9f96f05d03ab62c114508a231a2dce434cb.1669821213.git.asml.silence@gmail.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
  • Loading branch information
isilence authored and axboe committed Nov 30, 2022
1 parent 047b6ae commit c3bfb57
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion io_uring/poll.c
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ static int io_poll_check_events(struct io_kiocb *req, bool *locked)
if (unlikely(v != 1)) {
/* tw should be the owner and so have some refs */
if (WARN_ON_ONCE(!(v & IO_POLL_REF_MASK)))
return IOU_POLL_DONE;
return IOU_POLL_NO_ACTION;
if (v & IO_POLL_CANCEL_FLAG)
return -ECANCELED;
/*
Expand Down

0 comments on commit c3bfb57

Please sign in to comment.