From: Christoph Hellwig <hch@lst.de>
To: Yu Kuai <yukuai1@huaweicloud.com>
Cc: Christoph Hellwig <hch@lst.de>,
axboe@kernel.dk, linux-block@vger.kernel.org,
"yukuai (C)" <yukuai3@huawei.com>
Subject: Re: [PATCH 2/2] block: clear the holder releated fields on late disk_add failure
Date: Tue, 18 Oct 2022 10:26:51 +0200 [thread overview]
Message-ID: <20221018082651.GA26079@lst.de> (raw)
In-Reply-To: <8c5359e3-39ee-d363-9425-0cb8b716dcb0@huaweicloud.com>
On Tue, Oct 18, 2022 at 04:00:36PM +0800, Yu Kuai wrote:
> 1) in del_gendisk: (add a new api kobject_put_and_test)
>
> if (kobject_put_and_test(bd_holder_dir/slave_dir))
> bd_holder_dir/slave_dir = NULL;
>
> 2) in bd_link_disk_holder, get bd_holder_dir first:
>
> if (!kobject_get_unless_zero(bd_holder_dir))
> return -ENODEV;
> ...
> bd_find_holder_disk()
>
> Do you think this is ok?
I'm not quite sure what the point is.
If you want to really clean this up a good thing would be to remove
the delayed holder registration entirely and just do them in dm
after add_disk and remove them before del_gendisk. I've been wanting
to do that a few times but always gave up due to the mess in dm.
next prev parent reply other threads:[~2022-10-18 8:26 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-10-18 7:38 [PATCH 1/2] block: unregister holder kobject on late add_disk failure Christoph Hellwig
2022-10-18 7:38 ` [PATCH 2/2] block: clear the holder releated fields on late disk_add failure Christoph Hellwig
2022-10-18 8:00 ` Yu Kuai
2022-10-18 8:26 ` Christoph Hellwig [this message]
2022-10-18 8:40 ` Yu Kuai
2022-10-18 9:05 ` Yu Kuai
2022-10-19 6:55 ` Christoph Hellwig
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=20221018082651.GA26079@lst.de \
--to=hch@lst.de \
--cc=axboe@kernel.dk \
--cc=linux-block@vger.kernel.org \
--cc=yukuai1@huaweicloud.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;
as well as URLs for NNTP newsgroup(s).