From: Luis Chamberlain <mcgrof@kernel.org>
To: Tetsuo Handa <penguin-kernel@i-love.sakura.ne.jp>
Cc: Christoph Hellwig <hch@lst.de>, Jens Axboe <axboe@kernel.dk>,
linux-block <linux-block@vger.kernel.org>
Subject: Re: [PATCH] block: fix error handling for device_add_disk
Date: Tue, 21 Dec 2021 13:50:00 -0800 [thread overview]
Message-ID: <YcJMCPvyWZgolXdy@bombadil.infradead.org> (raw)
In-Reply-To: <e5a62dee-a420-f9c4-f33d-e154cf4b0d9e@i-love.sakura.ne.jp>
On Tue, Dec 21, 2021 at 08:41:18PM +0900, Tetsuo Handa wrote:
> On 2021/12/21 4:16, Luis Chamberlain wrote:
> > The kobject_alive() tells us if at least the device_add() had the
> > kobject_add() complete.
>
>
> Testing with error injection
>
> @@ -3284,6 +3284,9 @@ int device_add(struct device *dev)
> if (!dev)
> goto done;
>
> + if (!strcmp(current->comm, "a.out"))
> + goto done;
> +
> if (!dev->p) {
> error = device_private_init(dev);
> if (error)
>
> told me that kref count is 1 when reaching the out_disk_release_events label.
> Thus,
>
> if (!kobject_alive(&ddev->kobj))
>
> seems wrong.
Hrm.... quite unexpected.
> Christoph proposed deferring disk_alloc_events(). If it is safe to defer
> disk_alloc_events(), that can be a fix.
*If safe*, yes, agreed.
Luis
next prev parent reply other threads:[~2021-12-21 21:50 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-12-16 16:00 [PATCH] block: fix error handling for device_add_disk Tetsuo Handa
2021-12-16 16:18 ` Christoph Hellwig
2021-12-16 16:19 ` Christoph Hellwig
2021-12-17 10:37 ` Tetsuo Handa
2021-12-19 20:00 ` Luis Chamberlain
2021-12-20 8:23 ` Tetsuo Handa
2021-12-20 19:16 ` Luis Chamberlain
2021-12-21 11:41 ` Tetsuo Handa
2021-12-21 21:50 ` Luis Chamberlain [this message]
2021-12-21 10:08 ` Christoph Hellwig
2021-12-21 10:15 ` Christoph Hellwig
2021-12-21 10:21 ` Tetsuo Handa
2021-12-21 13:46 ` Tetsuo Handa
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=YcJMCPvyWZgolXdy@bombadil.infradead.org \
--to=mcgrof@kernel.org \
--cc=axboe@kernel.dk \
--cc=hch@lst.de \
--cc=linux-block@vger.kernel.org \
--cc=penguin-kernel@i-love.sakura.ne.jp \
/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