From: Coly Li <colyli@suse.de>
To: Heming Zhao <heming.zhao@suse.com>
Cc: linux-raid@vger.kernel.org, jes@trained-monkey.org, ncroxon@redhat.com
Subject: Re: [PATCH] Grow: fix can't change bitmap type from none to clustered.
Date: Thu, 23 Feb 2023 23:56:20 +0800 [thread overview]
Message-ID: <Y/eMpNTizBLDt2m3@enigma.lan> (raw)
In-Reply-To: <20230223143939.3817-1-heming.zhao@suse.com>
On Thu, Feb 23, 2023 at 10:39:39PM +0800, Heming Zhao wrote:
> Commit a042210648ed ("disallow create or grow clustered bitmap with
> writemostly set") introduced this bug. We should use 'true' logic not
> '== 0' to deny setting up clustered array under WRITEMOSTLY condition.
>
> How to trigger
>
> ```
> ~/mdadm # ./mdadm -Ss && ./mdadm --zero-superblock /dev/sd{a,b}
> ~/mdadm # ./mdadm -C /dev/md0 -l mirror -b clustered -e 1.2 -n 2 \
> /dev/sda /dev/sdb --assume-clean
> mdadm: array /dev/md0 started.
> ~/mdadm # ./mdadm --grow /dev/md0 --bitmap=none
> ~/mdadm # ./mdadm --grow /dev/md0 --bitmap=clustered
> mdadm: /dev/md0 disks marked write-mostly are not supported with clustered bitmap
> ```
>
> Signed-off-by: Heming Zhao <heming.zhao@suse.com>
Acked-by: Coly Li <colyli@suse.de>
> ---
> Grow.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/Grow.c b/Grow.c
> index 8f5cf07d10d9..bb5fe45c851c 100644
> --- a/Grow.c
> +++ b/Grow.c
> @@ -429,7 +429,7 @@ int Grow_addbitmap(char *devname, int fd, struct context *c, struct shape *s)
> dv = map_dev(disk.major, disk.minor, 1);
> if (!dv)
> continue;
> - if (((disk.state & (1 << MD_DISK_WRITEMOSTLY)) == 0) &&
> + if ((disk.state & (1 << MD_DISK_WRITEMOSTLY)) &&
> (strcmp(s->bitmap_file, "clustered") == 0)) {
> pr_err("%s disks marked write-mostly are not supported with clustered bitmap\n",devname);
> free(mdi);
--
Coly Li
next prev parent reply other threads:[~2023-02-23 15:56 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-02-23 14:39 [PATCH] Grow: fix can't change bitmap type from none to clustered Heming Zhao
2023-02-23 15:56 ` Coly Li [this message]
2023-02-23 16:24 ` Paul Menzel
2023-02-23 18:23 ` Jes Sorensen
2023-02-23 23:50 ` Heming Zhao
2023-03-01 2:10 ` Jes Sorensen
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=Y/eMpNTizBLDt2m3@enigma.lan \
--to=colyli@suse.de \
--cc=heming.zhao@suse.com \
--cc=jes@trained-monkey.org \
--cc=linux-raid@vger.kernel.org \
--cc=ncroxon@redhat.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.