Skip to content

Commit 56450c2

Browse files
committed
io_uring: clear req->result on IOPOLL re-issue
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>
1 parent 0fef948 commit 56450c2

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

fs/io_uring.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2049,6 +2049,7 @@ static void io_iopoll_complete(struct io_ring_ctx *ctx, unsigned int *nr_events,
20492049

20502050
req = list_first_entry(done, struct io_kiocb, inflight_entry);
20512051
if (READ_ONCE(req->result) == -EAGAIN) {
2052+
req->result = 0;
20522053
req->iopoll_completed = 0;
20532054
list_move_tail(&req->inflight_entry, &again);
20542055
continue;

0 commit comments

Comments
 (0)