linux-block.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@infradead.org>
To: Luis Chamberlain <mcgrof@kernel.org>
Cc: axboe@kernel.dk, hare@suse.de, bvanassche@acm.org,
	ming.lei@redhat.com, hch@infradead.org, jack@suse.cz,
	osandov@fb.com, linux-block@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	"Guilherme G. Piccoli" <gpiccoli@canonical.com>,
	Song Liu <songliubraving@fb.com>,
	linux-raid@vger.kernel.org
Subject: Re: [PATCH 2/5] md: replace GENHD_FL_UP with GENHD_FL_DISK_ADDED on is_mddev_broken()
Date: Wed, 21 Jul 2021 06:03:46 +0100	[thread overview]
Message-ID: <YPeqspNQrE7PvbXR@infradead.org> (raw)
In-Reply-To: <20210720182048.1906526-3-mcgrof@kernel.org>

On Tue, Jul 20, 2021 at 11:20:45AM -0700, Luis Chamberlain wrote:
> The GENHD_FL_DISK_ADDED flag is what we really want, as the
> flag GENHD_FL_UP could be set on a semi-initialized device.
> 
> Signed-off-by: Luis Chamberlain <mcgrof@kernel.org>

Based on the commit log for the patch adding this check I think this
is wrong  It actually wants to detected underlying devices for which
del_gendisk has been called.

> ---
>  drivers/md/md.h | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/drivers/md/md.h b/drivers/md/md.h
> index 832547cf038f..cf70e0cfa856 100644
> --- a/drivers/md/md.h
> +++ b/drivers/md/md.h
> @@ -764,9 +764,7 @@ struct md_rdev *md_find_rdev_rcu(struct mddev *mddev, dev_t dev);
>  
>  static inline bool is_mddev_broken(struct md_rdev *rdev, const char *md_type)
>  {
> -	int flags = rdev->bdev->bd_disk->flags;
> -
> -	if (!(flags & GENHD_FL_UP)) {
> +	if (!blk_disk_added(rdev->bdev->bd_disk)) {
>  		if (!test_and_set_bit(MD_BROKEN, &rdev->mddev->flags))
>  			pr_warn("md: %s: %s array has a missing/failed member\n",
>  				mdname(rdev->mddev), md_type);
> -- 
> 2.27.0
> 
---end quoted text---

  reply	other threads:[~2021-07-21  5:04 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-20 18:20 [PATCH 0/5] block: replace incorrect uses of GENHD_FL_UP Luis Chamberlain
2021-07-20 18:20 ` [PATCH 1/5] block: add flag for add_disk() completion notation Luis Chamberlain
2021-07-21  4:59   ` Christoph Hellwig
2021-07-20 18:20 ` [PATCH 2/5] md: replace GENHD_FL_UP with GENHD_FL_DISK_ADDED on is_mddev_broken() Luis Chamberlain
2021-07-21  5:03   ` Christoph Hellwig [this message]
2021-07-20 18:20 ` [PATCH 3/5] mmc/core/block: replace GENHD_FL_UP with GENHD_FL_DISK_ADDED Luis Chamberlain
2021-07-21  5:23   ` Christoph Hellwig
2021-07-20 18:20 ` [PATCH 4/5] nvme: " Luis Chamberlain
2021-07-21  5:31   ` Christoph Hellwig
2021-07-20 18:20 ` [PATCH 5/5] fs/block_dev: " Luis Chamberlain
2021-07-21  5:25   ` Christoph Hellwig
2021-08-11  2:42 ` [PATCH 0/5] block: replace incorrect uses of GENHD_FL_UP luomeng
2021-08-11  5:19   ` Christoph Hellwig
2021-08-12  2:07     ` luomeng

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=YPeqspNQrE7PvbXR@infradead.org \
    --to=hch@infradead.org \
    --cc=axboe@kernel.dk \
    --cc=bvanassche@acm.org \
    --cc=gpiccoli@canonical.com \
    --cc=hare@suse.de \
    --cc=jack@suse.cz \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-raid@vger.kernel.org \
    --cc=mcgrof@kernel.org \
    --cc=ming.lei@redhat.com \
    --cc=osandov@fb.com \
    --cc=songliubraving@fb.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).