提交 756ab7c0 编写于 作者: P Pavel Begunkov 提交者: Jens Axboe

io_uring: safer fallback_work free

Add extra wq flushing for fallback_work, that's not necessary but safer
if invariants of io_fallback_req_func() change.
Signed-off-by: NPavel Begunkov <asml.silence@gmail.com>
Link: https://lore.kernel.org/r/24179419d6748516299600bc914f50b9e0b02275.1633532552.git.asml.silence@gmail.comSigned-off-by: NJens Axboe <axboe@kernel.dk>
上级 6d63416d
......@@ -1262,7 +1262,6 @@ static __cold void io_fallback_req_func(struct work_struct *work)
mutex_unlock(&ctx->uring_lock);
}
percpu_ref_put(&ctx->refs);
}
static __cold struct io_ring_ctx *io_ring_ctx_alloc(struct io_uring_params *p)
......@@ -9212,6 +9211,7 @@ static __cold void io_ring_ctx_free(struct io_ring_ctx *ctx)
if (ctx->rsrc_backup_node)
io_rsrc_node_destroy(ctx->rsrc_backup_node);
flush_delayed_work(&ctx->rsrc_put_work);
flush_delayed_work(&ctx->fallback_work);
WARN_ON_ONCE(!list_empty(&ctx->rsrc_ref_list));
WARN_ON_ONCE(!llist_empty(&ctx->rsrc_put_llist));
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册