From: Alexandru Moise <00moses.alexander00@gmail.com>
To: Bart Van Assche <bart.vanassche@wdc.com>
Cc: "tj@kernel.org" <tj@kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"linux-block@vger.kernel.org" <linux-block@vger.kernel.org>,
"nborisov@suse.com" <nborisov@suse.com>,
"axboe@kernel.dk" <axboe@kernel.dk>, "shli@fb.com" <shli@fb.com>,
"gregkh@linuxfoundation.org" <gregkh@linuxfoundation.org>,
"joseph.qi@linux.alibaba.com" <joseph.qi@linux.alibaba.com>,
"arnd@arndb.de" <arnd@arndb.de>
Subject: Re: [PATCH v2] blk-cgroup: remove entries in blkg_tree before queue release
Date: Wed, 11 Apr 2018 23:23:20 +0200 [thread overview]
Message-ID: <20180411212320.GA26747@gmail.com> (raw)
In-Reply-To: <b7809887-24e6-3ad7-e8bd-4fe7ea0927c0@wdc.com>
On Wed, Apr 11, 2018 at 01:55:25PM -0600, Bart Van Assche wrote:
> On 04/11/18 13:00, Alexandru Moise wrote:
> > But the root cause of it is in blkcg_init_queue() when blkg_create() returns
> > an ERR ptr, because it tries to insert into a populated index into blkcg->blkg_tree,
> > the entry that we fail to remove at __blk_release_queue().
>
> Hello Alex,
>
> Had you considered something like the untested patch below?
>
> Thanks,
>
> Bart.
>
>
> diff --git a/block/blk-cgroup.c b/block/blk-cgroup.c
> index 1c16694ae145..f2ced19e74b8 100644
> --- a/block/blk-cgroup.c
> +++ b/block/blk-cgroup.c
> @@ -1191,14 +1191,17 @@ int blkcg_init_queue(struct request_queue *q)
> if (preloaded)
> radix_tree_preload_end();
>
> - if (IS_ERR(blkg))
> - return PTR_ERR(blkg);
> + if (IS_ERR(blkg)) {
> + ret = PTR_ERR(blkg);
> + goto destroy_all;
> + }
>
> q->root_blkg = blkg;
> q->root_rl.blkg = blkg;
>
> ret = blk_throtl_init(q);
> if (ret) {
> +destroy_all:
> spin_lock_irq(q->queue_lock);
> blkg_destroy_all(q);
> spin_unlock_irq(q->queue_lock);
>
Hi, I tested it, it doesn't solve the problem.
By the time you get here it's already too late, my patch
prevents this from failing in the first place.
I would have liked this more than my solution though.
../Alex
next prev parent reply other threads:[~2018-04-11 21:23 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-04-07 10:21 [PATCH v2] blk-cgroup: remove entries in blkg_tree before queue release Alexandru Moise
2018-04-09 22:09 ` Tejun Heo
2018-04-11 10:12 ` Alexandru Moise
2018-04-11 14:20 ` Tejun Heo
2018-04-11 14:28 ` Alexandru Moise
2018-04-11 14:46 ` Tejun Heo
2018-04-11 14:51 ` Tejun Heo
2018-04-11 14:56 ` Tejun Heo
2018-04-11 16:42 ` Bart Van Assche
2018-04-11 17:00 ` tj
2018-04-11 17:06 ` Bart Van Assche
2018-04-11 17:15 ` tj
2018-04-11 17:26 ` Bart Van Assche
2018-04-11 17:30 ` tj
2018-04-11 15:54 ` Bart Van Assche
2018-04-11 19:00 ` Alexandru Moise
2018-04-11 19:55 ` Bart Van Assche
2018-04-11 19:57 ` tj
2018-04-11 20:00 ` Bart Van Assche
2018-04-11 20:02 ` tj
2018-04-11 20:23 ` Bart Van Assche
2018-04-11 21:23 ` Alexandru Moise [this message]
2018-04-11 21:28 ` Bart Van Assche
2018-04-11 22:58 ` Alexandru Moise
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=20180411212320.GA26747@gmail.com \
--to=00moses.alexander00@gmail.com \
--cc=arnd@arndb.de \
--cc=axboe@kernel.dk \
--cc=bart.vanassche@wdc.com \
--cc=gregkh@linuxfoundation.org \
--cc=joseph.qi@linux.alibaba.com \
--cc=linux-block@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=nborisov@suse.com \
--cc=shli@fb.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).