linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Guilherme G. Piccoli" <kernel@gpiccoli.net>
To: Luis Chamberlain <mcgrof@kernel.org>, hch@infradead.org
Cc: axboe@kernel.dk, hare@suse.de,
	Bart Van Assche <bvanassche@acm.org>,
	Ming Lei <ming.lei@redhat.com>,
	jack@suse.cz, osandov@fb.com, linux-block@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [RFC 3/6] md: replace GENHD_FL_UP with GENHD_FL_DISK_ADDED on is_mddev_broken()
Date: Wed, 28 Jul 2021 16:20:01 -0300	[thread overview]
Message-ID: <CALJn8nOWtFBnuzqPpuOH6nqikUzZGUYWEnvwCFvmrCrC5MWSmw@mail.gmail.com> (raw)
In-Reply-To: <20210715202341.2016612-4-mcgrof@kernel.org>

On Thu, Jul 15, 2021 at 5:24 PM Luis Chamberlain <mcgrof@kernel.org> 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>
> ---
>  drivers/md/md.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/md/md.h b/drivers/md/md.h
> index 832547cf038f..80561bca1f51 100644
> --- a/drivers/md/md.h
> +++ b/drivers/md/md.h
> @@ -766,7 +766,7 @@ 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 (!(flags & GENHD_FL_DISK_ADDED)) {

Thanks for the patch Luis! And thanks Christoph for looping me in on
the last iteration.
I think specifically for md, both flags are interchangeable - if
add_disk() is not completed, I'm pretty sure we cannot have the array
properly working hence we shouldn't ever reach this check for such
device. Nevertheless, technically speaking Christoph seems correct and
we are checking here in fact if the disk was del_gendisk'ed().
My opinion is that we don't need to change this usage, if possible,
but I'm not strongly against the change if you feel it fits better.

Just double-checking - after del_gendisk(), this flag is removed anyways right?
Oh, and if possible, loop me in CC for next revisions, using this email.
Cheers,


Guilherme

  parent reply	other threads:[~2021-07-28 19:20 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-15 20:23 [RFC 0/6] block: enhance use of GENHD_FL_UP Luis Chamberlain
2021-07-15 20:23 ` [RFC 1/6] genhd: update docs for GENHD_FL_UP Luis Chamberlain
2021-07-16  5:50   ` Hannes Reinecke
2021-07-19  9:52   ` Christoph Hellwig
2021-07-15 20:23 ` [RFC 2/6] block: add flag for add_disk() completion notation Luis Chamberlain
2021-07-16  5:49   ` Hannes Reinecke
2021-07-16 20:00     ` Luis Chamberlain
2021-07-19 10:00   ` Christoph Hellwig
2021-07-19 22:38     ` Luis Chamberlain
2021-07-15 20:23 ` [RFC 3/6] md: replace GENHD_FL_UP with GENHD_FL_DISK_ADDED on is_mddev_broken() Luis Chamberlain
2021-07-16  5:51   ` Hannes Reinecke
2021-07-16 20:02     ` Luis Chamberlain
2021-07-28 19:20   ` Guilherme G. Piccoli [this message]
2021-07-15 20:23 ` [RFC 4/6] mmc/core/block: replace GENHD_FL_UP with GENHD_FL_DISK_ADDED Luis Chamberlain
2021-07-16  5:51   ` Hannes Reinecke
2021-07-15 20:23 ` [RFC 5/6] nvme: " Luis Chamberlain
2021-07-16  5:53   ` Hannes Reinecke
2021-07-15 20:23 ` [RFC 6/6] fs/block_dev: " Luis Chamberlain
2021-07-19  9:56 ` [RFC 0/6] block: enhance use of GENHD_FL_UP 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=CALJn8nOWtFBnuzqPpuOH6nqikUzZGUYWEnvwCFvmrCrC5MWSmw@mail.gmail.com \
    --to=kernel@gpiccoli.net \
    --cc=axboe@kernel.dk \
    --cc=bvanassche@acm.org \
    --cc=hare@suse.de \
    --cc=hch@infradead.org \
    --cc=jack@suse.cz \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mcgrof@kernel.org \
    --cc=ming.lei@redhat.com \
    --cc=osandov@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).