From: Doug Ledford <dledford@redhat.com>
To: Jes.Sorensen@redhat.com
Cc: neilb@suse.de, linux-raid@vger.kernel.org
Subject: Re: [PATCH 1/1] Avoid OOPS when reshaping raid1 to raid0
Date: Thu, 22 Mar 2012 12:19:29 -0400 [thread overview]
Message-ID: <4F6B5111.7030905@redhat.com> (raw)
In-Reply-To: <1332432953-30091-2-git-send-email-Jes.Sorensen@redhat.com>
[-- Attachment #1: Type: text/plain, Size: 1492 bytes --]
On 03/22/2012 12:15 PM, Jes.Sorensen@redhat.com wrote:
> From: Jes Sorensen <Jes.Sorensen@redhat.com>
>
> raid1 arrays do not have the notion of chunk size. Set the existing
> chunk size of the new raid0 to the same as the proposed new chunk size
> to avoid a divide by zero OOPS when aligning the size of the new array
> to that of the chunk size.
>
> Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
> ---
> drivers/md/raid0.c | 8 ++++++++
> 1 files changed, 8 insertions(+), 0 deletions(-)
>
> diff --git a/drivers/md/raid0.c b/drivers/md/raid0.c
> index 6f31f55..dff8d6b 100644
> --- a/drivers/md/raid0.c
> +++ b/drivers/md/raid0.c
> @@ -639,6 +639,14 @@ static void *raid0_takeover_raid1(struct mddev *mddev)
> mddev->new_level = 0;
> mddev->new_layout = 0;
> mddev->new_chunk_sectors = 128; /* by default set chunk size to 64k */
> + mddev->chunk_sectors = 128; /*
> + * a raid1 one doesn't have the
> + * notion of chunk size, so set
> + * existing chunk_sector to match the
> + * new size to avoid divide by zero
> + * when aligning the size of the new
> + * raid0 to the existing chunk size.
> + */
> mddev->delta_disks = 1 - mddev->raid_disks;
> mddev->raid_disks = 1;
> /* make sure it will be not marked as dirty */
Acked-by: Doug Ledford <dledford@redhat.com>
--
Doug Ledford <dledford@redhat.com>
GPG KeyID: 0E572FDD
http://people.redhat.com/dledford
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 900 bytes --]
next prev parent reply other threads:[~2012-03-22 16:19 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-03-22 16:15 [PATCH 0/1] Avoid OOPS when reshaping raid1 to raid0 Jes.Sorensen
2012-03-22 16:15 ` [PATCH 1/1] " Jes.Sorensen
2012-03-22 16:19 ` Doug Ledford [this message]
2012-03-25 22:29 ` NeilBrown
2012-03-26 8:29 ` 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=4F6B5111.7030905@redhat.com \
--to=dledford@redhat.com \
--cc=Jes.Sorensen@redhat.com \
--cc=linux-raid@vger.kernel.org \
--cc=neilb@suse.de \
/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.