All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mariusz Tkaczyk <mtkaczyk@kernel.org>
To: Yu Kuai <yukuai1@huaweicloud.com>
Cc: song@kernel.org, linux-raid@vger.kernel.org,
	yangerkun@huawei.com, "yukuai (C)" <yukuai3@huawei.com>
Subject: Re: [PATCH] mdadm: fix --grow with --add for linear
Date: Mon, 27 Jan 2025 10:35:40 +0100	[thread overview]
Message-ID: <20250127103540.2352ae17@mtkaczyk-private-dev> (raw)
In-Reply-To: <825cd5bf-9e3c-61c1-0cf0-3b46cfb21d53@huaweicloud.com>

On Sun, 26 Jan 2025 16:22:58 +0800
Yu Kuai <yukuai1@huaweicloud.com> wrote:

> 在 2024/12/31 16:49, Mariusz Tkaczyk 写道:
> > On Fri, 27 Dec 2024 14:07:02 +0800
> > Yu Kuai <yukuai1@huaweicloud.com> wrote:
> >   
> >> From: Yu Kuai <yukuai3@huawei.com>
> >>
> >> For the case mdadm --grow with --add, the s.btype should not be
> >> initialized yet, hence BitmapUnknown should be checked instead of
> >> BitmapNone.  
> > 
> > Hi Kuai,
> > 
> > For commit extra clarity it would be nice to include command you are
> > executing.
> > 
> > What if someone will do (not tested):
> > #mdadm --grow /dev/md0 --add /dev/sdx --bitmap=none
> > 
> > I think that it is perfectly valid, now it may work but I expect
> > your change to broke it.  
> 
> Hi,
> 
> Sorry for the late reply, I forgot about this patch somehow :(
> 
> Changes from commit 581ba1341017:
> 
> @@ -1634,7 +1625,7 @@ int main(int argc, char *argv[])
>                  if (devs_found > 1 && s.raiddisks == 0 && s.level == 
> UnSet) {
>                          /* must be '-a'. */
>                          if (s.size > 0 || s.chunk ||
> -                           s.layout_str || s.bitmap_file) {
> +                           s.layout_str || s.btype != BitmapNone) {
>                                  pr_err("--add cannot be used with
> other geometry changes in --grow mode\n");
>                                  rv = 1;
>                                  break;
> 
> 
> Hence before the commit, bitmap=none is not valid in this case as
> well, because s.bitmap_file will set to "none" in this case.
> 
> Thanks,
> Kuai
> 

OK, ack from my side then.
If there will be no more comments we can merge it. I opened
PR to test it:
https://github.com/md-raid-utilities/mdadm/pull/145

Thanks,
Mariusz

      reply	other threads:[~2025-01-27  9:35 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-27  6:07 [PATCH] mdadm: fix --grow with --add for linear Yu Kuai
2024-12-31  8:49 ` Mariusz Tkaczyk
2025-01-26  8:22   ` Yu Kuai
2025-01-27  9:35     ` Mariusz Tkaczyk [this message]

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=20250127103540.2352ae17@mtkaczyk-private-dev \
    --to=mtkaczyk@kernel.org \
    --cc=linux-raid@vger.kernel.org \
    --cc=song@kernel.org \
    --cc=yangerkun@huawei.com \
    --cc=yukuai1@huaweicloud.com \
    --cc=yukuai3@huawei.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.