It seems no opcode may return -EAGAIN for non-blocking case and expect to be reissued. Remove retry code from io_wq_submit_work(). Signed-off-by: Pavel Begunkov <asml.silence@xxxxxxxxx> --- fs/io_uring.c | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) diff --git a/fs/io_uring.c b/fs/io_uring.c index b9dd94143c30..b2ce8a3d3dd1 100644 --- a/fs/io_uring.c +++ b/fs/io_uring.c @@ -4622,26 +4622,14 @@ static void io_wq_submit_work(struct io_wq_work **workptr) struct io_wq_work *work = *workptr; struct io_kiocb *req = container_of(work, struct io_kiocb, work); struct io_kiocb *nxt = NULL; - int ret = 0; + int ret; /* if NO_CANCEL is set, we must still run the work */ if ((work->flags & (IO_WQ_WORK_CANCEL|IO_WQ_WORK_NO_CANCEL)) == IO_WQ_WORK_CANCEL) { ret = -ECANCELED; - } - - if (!ret) { - do { - ret = io_issue_sqe(req, NULL, &nxt, false); - /* - * We can get EAGAIN for polled IO even though we're - * forcing a sync submission from here, since we can't - * wait for request slots on the block side. - */ - if (ret != -EAGAIN) - break; - cond_resched(); - } while (1); + } else { + ret = io_issue_sqe(req, NULL, &nxt, false); } /* drop submission reference */ -- 2.24.0