On 1/15/20 7:37 PM, Bijan Mottahedeh wrote: > io_issue_sqe() calls io_iopoll_req_issued() which manipulates poll_list, > so acquire ctx->uring_lock beforehand similar to other instances of > calling io_issue_sqe(). Is the below not enough? diff --git a/fs/io_uring.c b/fs/io_uring.c index f9709a3a673c..900e86189ce7 100644 --- a/fs/io_uring.c +++ b/fs/io_uring.c @@ -4272,10 +4272,18 @@ static int io_issue_sqe(struct io_kiocb *req, const struct io_uring_sqe *sqe, return ret; if (ctx->flags & IORING_SETUP_IOPOLL) { + const bool in_async = req->in_async; + if (req->result == -EAGAIN) return -EAGAIN; + if (in_async) + mutex_lock(&ctx->uring_lock); + io_iopoll_req_issued(req); + + if (in_async) + mutex_unlock(&ctx->uring_lock); } return 0; -- Jens Axboe