Skip to content

Commit

Permalink
io_uring: clear req->result on IOPOLL re-issue
Browse files Browse the repository at this point in the history
commit 56450c2 upstream.

Make sure we clear req->result, which was set to -EAGAIN for retry
purposes, when moving it to the reissue list. Otherwise we can end up
retrying a request more than once, which leads to weird results in
the io-wq handling (and other spots).

Cc: stable@vger.kernel.org
Reported-by: Andres Freund <andres@anarazel.de>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
axboe authored and gregkh committed Sep 3, 2020
1 parent 116790c commit 1506fdc
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions fs/io_uring.c
Expand Up @@ -1810,6 +1810,7 @@ static void io_iopoll_complete(struct io_ring_ctx *ctx, unsigned int *nr_events,

req = list_first_entry(done, struct io_kiocb, list);
if (READ_ONCE(req->result) == -EAGAIN) {
req->result = 0;
req->iopoll_completed = 0;
list_move_tail(&req->list, &again);
continue;
Expand Down

0 comments on commit 1506fdc

Please sign in to comment.