diff --git a/io_uring/io_uring.c b/io_uring/io_uring.c index 958c3b619020..b21f2bafaeb0 100644 --- a/io_uring/io_uring.c +++ b/io_uring/io_uring.c @@ -3000,8 +3000,11 @@ __cold void io_uring_cancel_generic(bool cancel_all, struct io_sq_data *sqd) bool loop = false; io_uring_drop_tctx_refs(current); + if (!tctx_inflight(tctx, !cancel_all)) + break; + /* read completions before cancelations */ - inflight = tctx_inflight(tctx, !cancel_all); + inflight = tctx_inflight(tctx, false); if (!inflight) break;