diff --git a/fs/io_uring.c b/fs/io_uring.c index 7d276efc9a7a9929123ac29ae7643e70431a24e0..b937056df08acd8c16392f4fd2ed3da945f9f159 100644 --- a/fs/io_uring.c +++ b/fs/io_uring.c @@ -7364,10 +7364,11 @@ static void io_uring_cancel_files(struct io_ring_ctx *ctx, finish_wait(&ctx->inflight_wait, &wait); continue; } + } else { + io_wq_cancel_work(ctx->io_wq, &cancel_req->work); + io_put_req(cancel_req); } - io_wq_cancel_work(ctx->io_wq, &cancel_req->work); - io_put_req(cancel_req); schedule(); finish_wait(&ctx->inflight_wait, &wait); }