From: Jes Sorensen <Jes.Sorensen@redhat.com>
To: Xiao Ni <xni@redhat.com>
Cc: linux-raid@vger.kernel.org
Subject: Re: [PATCH] mdadm: Check bitmap first when reshape raid1 to raid0
Date: Fri, 23 Oct 2015 16:35:00 -0400 [thread overview]
Message-ID: <wrfjwpud9vd7.fsf@redhat.com> (raw)
In-Reply-To: <1445589144-12157-1-git-send-email-xni@redhat.com> (Xiao Ni's message of "Fri, 23 Oct 2015 16:32:24 +0800")
Xiao Ni <xni@redhat.com> writes:
> One raid1 with bitmap is composed by 4 disks. It'll fail when rashape to raid0
> and lose 3 disks. It should check bitmap first when reshape raid1 to raid0.
> ---
> Grow.c | 9 ++++++---
> 1 file changed, 6 insertions(+), 3 deletions(-)
Xiao,
I believe you are also required to apply a Signed-off-by: line when
posting patches against mdadm.
Cheers,
Jes
>
> diff --git a/Grow.c b/Grow.c
> index 80d7b22..5e9b0bb 100644
> --- a/Grow.c
> +++ b/Grow.c
> @@ -1898,6 +1898,12 @@ size_change_error:
> array.layout == ((1 << 8) + 2) && !(array.raid_disks & 1)) ||
> (s->level == 0 && array.level == 1 && sra)) {
> int err;
> +
> + if (array.state & (1<<MD_SB_BITMAP_PRESENT)) {
> + cont_err("Bitmap must be removed before level can be changed\n");
> + rv = 1;
> + goto release;
> + }
> err = remove_disks_for_takeover(st, sra, array.layout);
> if (err) {
> dprintf("Array cannot be reshaped\n");
> @@ -2706,9 +2712,6 @@ static int impose_level(int fd, int level, char *devname, int verbose)
> err = errno;
> pr_err("%s: could not set level to %s\n",
> devname, c);
> - if (err == EBUSY &&
> - (array.state & (1<<MD_SB_BITMAP_PRESENT)))
> - cont_err("Bitmap must be removed before level can be changed\n");
> return err;
> }
> if (verbose >= 0)
next parent reply other threads:[~2015-10-23 20:35 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1445589144-12157-1-git-send-email-xni@redhat.com>
2015-10-23 20:35 ` Jes Sorensen [this message]
[not found] <1445751362-15677-1-git-send-email-xni@redhat.com>
2015-10-25 5:38 ` Fwd: [PATCH] mdadm: Check bitmap first when reshape raid1 to raid0 Xiao Ni
2015-10-25 20:21 ` Neil Brown
2015-10-26 12:25 ` Xiao Ni
2015-10-26 23:10 ` Neil Brown
2015-10-27 6:24 ` Xiao Ni
2015-11-02 15:18 [PATCH] mdadm: check " Xiao Ni
2015-11-02 16:04 ` Xiao Ni
-- strict thread matches above, loose matches on Subject: below --
2015-11-03 0:25 Xiao Ni
2015-11-21 1:47 ` Xiao Ni
2015-12-21 2:47 ` NeilBrown
2015-12-21 6:00 ` Xiao Ni
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=wrfjwpud9vd7.fsf@redhat.com \
--to=jes.sorensen@redhat.com \
--cc=linux-raid@vger.kernel.org \
--cc=xni@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 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).