Commit 14cfbb7a authored by Hao Xu's avatar Hao Xu Committed by Jens Axboe
Browse files

io_uring: fix wrong condition to grab uring lock



Grab uring lock when we are in io-worker rather than in the original
or system-wq context since we already hold it in these two situation.

Signed-off-by: default avatarHao Xu <haoxu@linux.alibaba.com>
Fixes: b66ceaf3 ("io_uring: move iopoll reissue into regular IO path")
Link: https://lore.kernel.org/r/20211014140400.50235-1-haoxu@linux.alibaba.com


Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent 3f008385
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -2949,7 +2949,7 @@ static void kiocb_done(struct kiocb *kiocb, ssize_t ret,
			struct io_ring_ctx *ctx = req->ctx;

			req_set_fail(req);
			if (issue_flags & IO_URING_F_NONBLOCK) {
			if (!(issue_flags & IO_URING_F_NONBLOCK)) {
				mutex_lock(&ctx->uring_lock);
				__io_req_complete(req, issue_flags, ret, cflags);
				mutex_unlock(&ctx->uring_lock);