io_req_complete_failed() only does io_req_complete_post(), which we don't need to protect by ->uring_lock, so remove mutex_lock / unlock from there. Signed-off-by: Pavel Begunkov <asml.silence@xxxxxxxxx> --- fs/io_uring.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/fs/io_uring.c b/fs/io_uring.c index 5e99473ad6fc..bdab831a1185 100644 --- a/fs/io_uring.c +++ b/fs/io_uring.c @@ -2111,12 +2111,7 @@ static void io_req_task_work_add(struct io_kiocb *req) static void io_req_task_cancel(struct io_kiocb *req) { - struct io_ring_ctx *ctx = req->ctx; - - /* ctx is guaranteed to stay alive while we hold uring_lock */ - mutex_lock(&ctx->uring_lock); io_req_complete_failed(req, req->result); - mutex_unlock(&ctx->uring_lock); } static void io_req_task_submit(struct io_kiocb *req) -- 2.32.0