From: Bart Van Assche <bvanassche@acm.org>
To: Dennis Zhou <dennis@kernel.org>, Jens Axboe <axboe@kernel.dk>,
Tejun Heo <tj@kernel.org>, Josef Bacik <josef@toxicpanda.com>
Cc: kernel-team@fb.com, linux-block@vger.kernel.org,
cgroups@vger.kernel.org, linux-kernel@vger.kernel.org,
Ming Lei <ming.lei@redhat.com>
Subject: Re: [PATCH] blkcg: handle dying request_queue when associating a blkg
Date: Tue, 11 Dec 2018 15:16:13 -0800 [thread overview]
Message-ID: <1544570173.185366.397.camel@acm.org> (raw)
In-Reply-To: <20181211230308.66276-1-dennis@kernel.org>
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.
next prev parent reply other threads:[~2018-12-11 23:16 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-12-11 23:03 [PATCH] blkcg: handle dying request_queue when associating a blkg Dennis Zhou
2018-12-11 23:16 ` Bart Van Assche [this message]
2018-12-12 4:06 ` Dennis Zhou
2018-12-12 23:54 ` Bart Van Assche
2018-12-13 15:47 ` Dennis Zhou
2018-12-13 0:43 ` Jens Axboe
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1544570173.185366.397.camel@acm.org \
--to=bvanassche@acm.org \
--cc=axboe@kernel.dk \
--cc=cgroups@vger.kernel.org \
--cc=dennis@kernel.org \
--cc=josef@toxicpanda.com \
--cc=kernel-team@fb.com \
--cc=linux-block@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=ming.lei@redhat.com \
--cc=tj@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).