io_uring/rsrc: remove rsrc_data refs
[linux-block.git] / io_uring / io_uring.c
index 3c1c8c788b7bf36158313dba77338dd312c9c00e..3d43df8f1e4e9a07aef7eece00812d47cb69847f 100644 (file)
@@ -2831,8 +2831,8 @@ static __cold void io_ring_ctx_free(struct io_ring_ctx *ctx)
 {
        io_sq_thread_finish(ctx);
        /* __io_rsrc_put_work() may need uring_lock to progress, wait w/o it */
-       io_wait_rsrc_data(ctx->buf_data);
-       io_wait_rsrc_data(ctx->file_data);
+       if (WARN_ON_ONCE(!list_empty(&ctx->rsrc_ref_list)))
+               return;
 
        mutex_lock(&ctx->uring_lock);
        if (ctx->buf_data)