[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20200901151009.598705719@linuxfoundation.org>
Date: Tue, 1 Sep 2020 17:10:42 +0200
From: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
To: linux-kernel@...r.kernel.org
Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
stable@...r.kernel.org, Andres Freund <andres@...razel.de>,
Jens Axboe <axboe@...nel.dk>
Subject: [PATCH 5.8 186/255] io_uring: clear req->result on IOPOLL re-issue
From: Jens Axboe <axboe@...nel.dk>
commit 56450c20fe10d4d93f58019109aa4e06fc0b9206 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@...r.kernel.org
Reported-by: Andres Freund <andres@...razel.de>
Signed-off-by: Jens Axboe <axboe@...nel.dk>
Signed-off-by: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
---
fs/io_uring.c | 1 +
1 file changed, 1 insertion(+)
--- a/fs/io_uring.c
+++ b/fs/io_uring.c
@@ -1810,6 +1810,7 @@ static void io_iopoll_complete(struct io
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;
Powered by blists - more mailing lists