From: "heming.zhao@suse.com" <heming.zhao@suse.com>
To: Christoph Hellwig <hch@lst.de>, song@kernel.org
Cc: lidong.zhong@suse.com, linux-raid@vger.kernel.org
Subject: Re: [PATCH 2/2] md: split mddev_find
Date: Sun, 4 Apr 2021 10:32:30 +0800 [thread overview]
Message-ID: <ef2a6db9-ff1b-2dc0-a104-56bda46bc5ba@suse.com> (raw)
In-Reply-To: <20210403161529.659555-3-hch@lst.de>
On 4/4/21 12:15 AM, Christoph Hellwig wrote:
> Split mddev_find into a simple mddev_find that just finds an existing
> mddev by the unit number, and a more complicated mddev_find that deals
> with find or allocating a mddev.
>
> ... ...
> Fixes: d3374825ce57 ("md: make devices disappear when they are no longer needed.")
> Reported-by: Zhao Heming <heming.zhao@suse.com>
> Signed-off-by: Christoph Hellwig <hch@lst.de>
> ---
> drivers/md/md.c | 24 +++++++++++++++++++-----
> 1 file changed, 19 insertions(+), 5 deletions(-)
>
> ... ...
> @@ -6530,11 +6546,9 @@ static void autorun_devices(int part)
>
> md_probe(dev);
> mddev = mddev_find(dev);
> - if (!mddev || !mddev->gendisk) {
> - if (mddev)
> - mddev_put(mddev);
> + if (!mddev)
> break;
> - }
> +
> if (mddev_lock(mddev))
> pr_warn("md: %s locked, cannot run\n", mdname(mddev));
> else if (mddev->raid_disks || mddev->major_version
>
autorun_devices use md_probe (when create_on_open is ture) to create mddev & gendisk,
mddev_find is only need to do finding job there.
looks good to me.
Reviewed-by: Heming Zhao <heming.zhao@suse.com>
Thanks,
Heming
next prev parent reply other threads:[~2021-04-04 2:32 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-04-03 16:15 split mddev_find and don't create new instance in ->open Christoph Hellwig
2021-04-03 16:15 ` [PATCH 1/2] md: factor out a mddev_find_locked helper from mddev_find Christoph Hellwig
2021-04-04 2:24 ` heming.zhao
2021-04-04 6:27 ` Christoph Hellwig
2021-04-03 16:15 ` [PATCH 2/2] md: split mddev_find Christoph Hellwig
2021-04-04 2:32 ` heming.zhao [this message]
2021-04-05 17:11 ` split mddev_find and don't create new instance in ->open Song Liu
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=ef2a6db9-ff1b-2dc0-a104-56bda46bc5ba@suse.com \
--to=heming.zhao@suse.com \
--cc=hch@lst.de \
--cc=lidong.zhong@suse.com \
--cc=linux-raid@vger.kernel.org \
--cc=song@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