Linux-Raid Archives mirror
 help / color / mirror / Atom feed
* Re: [PATCH 2/5] md: replace GENHD_FL_UP with GENHD_FL_DISK_ADDED on is_mddev_broken()
       [not found] ` <20210720182048.1906526-3-mcgrof@kernel.org>
@ 2021-07-21  5:03   ` Christoph Hellwig
  0 siblings, 0 replies; only message in thread
From: Christoph Hellwig @ 2021-07-21  5:03 UTC (permalink / raw
  To: Luis Chamberlain
  Cc: axboe, hare, bvanassche, ming.lei, hch, jack, osandov,
	linux-block, linux-kernel, Guilherme G. Piccoli, Song Liu,
	linux-raid

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---

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-07-21  5:04 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20210720182048.1906526-1-mcgrof@kernel.org>
     [not found] ` <20210720182048.1906526-3-mcgrof@kernel.org>
2021-07-21  5:03   ` [PATCH 2/5] md: replace GENHD_FL_UP with GENHD_FL_DISK_ADDED on is_mddev_broken() Christoph Hellwig

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 read-only IMAP folder(s) and NNTP newsgroup(s).