On Tue, 2018-12-11 at 18:03 -0500, Dennis Zhou wrote:
> diff --git a/block/blk-cgroup.c b/block/blk-cgroup.c
> index 6bd0619a7d6e..c30661ddc873 100644
> --- a/block/blk-cgroup.c
> +++ b/block/blk-cgroup.c
> @@ -202,6 +202,12 @@ static struct blkcg_gq *blkg_create(struct blkcg *blkcg,
> WARN_ON_ONCE(!rcu_read_lock_held());
> lockdep_assert_held(&q->queue_lock);
>
> + /* request_queue is dying, do not create/recreate a blkg */
> + if (blk_queue_dying(q)) {
> + ret = -ENODEV;
> + goto err_free_blkg;
> + }
> +
> /* blkg holds a reference to blkcg */
> if (!css_tryget_online(&blkcg->css)) {
> ret = -ENODEV;
What prevents that the queue state changes after blk_queue_dying() has returned
and before blkg_create() returns? Are you sure you don't need to protect this
code with a blk_queue_enter() / blk_queue_exit() pair?
Bart.