]> Git Repo - linux.git/commitdiff
io_uring: clear req->result on IOPOLL re-issue
authorJens Axboe <[email protected]>
Thu, 27 Aug 2020 00:58:26 +0000 (18:58 -0600)
committerJens Axboe <[email protected]>
Thu, 27 Aug 2020 00:58:26 +0000 (18:58 -0600)
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: [email protected]
Reported-by: Andres Freund <[email protected]>
Signed-off-by: Jens Axboe <[email protected]>
fs/io_uring.c

index bd2d8de3f2e8f848fc9d60c25e99e6be19bdc567..6df08287c59e14d4310c9a6c92c052989ae55a45 100644 (file)
@@ -2049,6 +2049,7 @@ static void io_iopoll_complete(struct io_ring_ctx *ctx, unsigned int *nr_events,
 
                req = list_first_entry(done, struct io_kiocb, inflight_entry);
                if (READ_ONCE(req->result) == -EAGAIN) {
+                       req->result = 0;
                        req->iopoll_completed = 0;
                        list_move_tail(&req->inflight_entry, &again);
                        continue;
This page took 0.066667 seconds and 4 git commands to generate.