linux-raid.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: NeilBrown <neilb@suse.com>
To: Xiao Ni <xni@redhat.com>
Cc: Jes.Sorensen@redhat.com, linux-raid@vger.kernel.org
Subject: Re: [MDADM PATCH] Check and remove bitmap first when reshape to raid0
Date: Tue, 22 Dec 2015 15:20:02 +1100	[thread overview]
Message-ID: <87twnb2jyl.fsf@notabene.neil.brown.name> (raw)
In-Reply-To: <1450753774-4358-1-git-send-email-xni@redhat.com>

[-- Attachment #1: Type: text/plain, Size: 1194 bytes --]

On Tue, Dec 22 2015, Xiao Ni wrote:

> If reshape one raid device with bitmap to raid0, the reshape progress will
> start. But it'll fail and lose some components. So it should remove bitmap 
> first. 
>
> Signed-off-by: Xiao Ni <xni@redhat.com>
> ---
>  Grow.c | 9 +++++++++
>  1 file changed, 9 insertions(+)
>
> diff --git a/Grow.c b/Grow.c
> index 6dfb9c9..db4daa8 100755
> --- a/Grow.c
> +++ b/Grow.c
> @@ -1590,6 +1590,15 @@ int Grow_reshape(char *devname, int fd,
>  		pr_err("Cannot increase raid-disks on this array beyond %d\n", st->max_devs);
>  		return 1;
>  	}
> +	if (s->level == 0 && 
> +	    (array.state & (1<<MD_SB_BITMAP_PRESENT)) && 
> +	    !(array.state & (1<<MD_SB_CLUSTERED))) {
> +                array.state &= ~(1<<MD_SB_BITMAP_PRESENT);
> +                if (ioctl(fd, SET_ARRAY_INFO, &array)!= 0) {
> +                        pr_err("failed to remove internal bitmap.\n");
> +                        return 1;
> +                }
> +        }
>  
>  	/* in the external case we need to check that the requested reshape is
>  	 * supported, and perform an initial check that the container holds the

applied, thanks.

NeilBrown

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 818 bytes --]

  reply	other threads:[~2015-12-22  4:20 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-22  3:09 [MDADM PATCH] Check and remove bitmap first when reshape to raid0 Xiao Ni
2015-12-22  4:20 ` NeilBrown [this message]
  -- strict thread matches above, loose matches on Subject: below --
2015-12-21  8:23 Xiao Ni
2015-12-21 21:06 ` NeilBrown

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=87twnb2jyl.fsf@notabene.neil.brown.name \
    --to=neilb@suse.com \
    --cc=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).