From: Yu Kuai <yukuai1@huaweicloud.com>
To: Liu Shixin <liushixin2@huawei.com>, Jens Axboe <axboe@kernel.dk>
Cc: linux-block@vger.kernel.org, linux-kernel@vger.kernel.org,
"yukuai (C)" <yukuai3@huawei.com>
Subject: Re: [PATCH] blk-mq: only unregister sysfs when registration succeeded
Date: Sat, 12 Nov 2022 18:44:37 +0800 [thread overview]
Message-ID: <607beb5b-8d54-b795-8a05-76352d7ed863@huaweicloud.com> (raw)
In-Reply-To: <20221112110754.1109979-1-liushixin2@huawei.com>
Hi,
在 2022/11/12 19:07, Liu Shixin 写道:
> kobject_del() must not be called if kobject_add() has not been called.
> Hence only unregister sysfs when registration succeeded.
>
From what I see, the blk_queue_registered() from caller
blk_unregister_queue() can already prevent that. QUEUE_FLAG_REGISTERED
will only be set if blk_register_queue() succeed.
Thanks,
Kuai
> Signed-off-by: Liu Shixin <liushixin2@huawei.com>
> ---
> block/blk-mq-sysfs.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/block/blk-mq-sysfs.c b/block/blk-mq-sysfs.c
> index 93997d297d42..63f2df2500d9 100644
> --- a/block/blk-mq-sysfs.c
> +++ b/block/blk-mq-sysfs.c
> @@ -279,6 +279,8 @@ void blk_mq_sysfs_unregister(struct gendisk *disk)
> unsigned long i;
>
> lockdep_assert_held(&q->sysfs_dir_lock);
> + if (!q->mq_sysfs_init_done)
> + return;
>
> queue_for_each_hw_ctx(q, hctx, i)
> blk_mq_unregister_hctx(hctx);
>
next prev parent reply other threads:[~2022-11-12 10:44 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-12 11:07 Liu Shixin
2022-11-12 10:44 ` Yu Kuai [this message]
2022-11-12 10:57 ` Yu Kuai
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=607beb5b-8d54-b795-8a05-76352d7ed863@huaweicloud.com \
--to=yukuai1@huaweicloud.com \
--cc=axboe@kernel.dk \
--cc=linux-block@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=liushixin2@huawei.com \
--cc=yukuai3@huawei.com \
/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
all inboxes | Powered by JetHome®