lkml.org 
[lkml]   [2018]   [Dec]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] blkcg: handle dying request_queue when associating a blkg
From
Date
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.

\
 
 \ /
  Last update: 2018-12-12 00:16    [W:0.125 / U:0.088 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site