linux-raid.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Neil Brown <neilb@suse.de>
To: "Trela, Maciej" <Maciej.Trela@intel.com>
Cc: "linux-raid@vger.kernel.org" <linux-raid@vger.kernel.org>,
	"Williams, Dan J" <dan.j.williams@intel.com>,
	"Ciechanowski, Ed" <ed.ciechanowski@intel.com>
Subject: Re: [PATCH 3/3] md: Add support for Raid0->Raid10 takeover
Date: Mon, 1 Feb 2010 11:08:29 +1100	[thread overview]
Message-ID: <20100201110829.5516c80e@notabene.brown> (raw)
In-Reply-To: <F2A46F4A087B8547923AD59C289DC90E01D16228@irsmsx002.ger.corp.intel.com>

On Fri, 29 Jan 2010 14:54:21 +0000
"Trela, Maciej" <Maciej.Trela@intel.com> wrote:


> +static void *raid10_takeover_raid0(mddev_t *mddev)
> +{
> +	mdk_rdev_t *rdev;
> +
> +	if (mddev->degraded > 0)
> +	{
> +	    printk(KERN_ERR "error: degraded raid0!\n");
> +		return ERR_PTR(-EINVAL);
> +	}
> +	
> +	/* Update slot numbers to obtain 
> +	 * degraded raid10 with missing mirrors
> +	 */
> +	list_for_each_entry(rdev, &mddev->disks, same_set) {
> +		rdev->raid_disk *= 2;
> +	}
> +	
> +	/* Set new parameters */
> +	mddev->new_level = 10;
> +	/* new layout: far_copies = 1, 
> +       near_copies = raid0->raid_disks */
> +	mddev->new_layout = (1<<8) + mddev->raid_disks;
> +	mddev->delta_disks = mddev->raid_disks;
> +	mddev->degraded = mddev->raid_disks;
> +	mddev->raid_disks *= 2;

You are confusing raid_disk with near_copies.  They are very different things.

Presumably you want to make 'near_copies' always be 2.

NeilBrown


  reply	other threads:[~2010-02-01  0:08 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-01-29 14:54 [PATCH 3/3] md: Add support for Raid0->Raid10 takeover Trela, Maciej
2010-02-01  0:08 ` Neil Brown [this message]
2010-02-03 12:16   ` Trela, Maciej
2010-02-03 12:29   ` [PATCH 4/4] md: Enable takeover for external metadata Trela, Maciej
2010-02-10  5:57     ` Neil Brown
2010-02-10 17:36       ` Dan Williams
2010-02-11 12:34         ` Trela, Maciej

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=20100201110829.5516c80e@notabene.brown \
    --to=neilb@suse.de \
    --cc=Maciej.Trela@intel.com \
    --cc=dan.j.williams@intel.com \
    --cc=ed.ciechanowski@intel.com \
    --cc=linux-raid@vger.kernel.org \
    /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).