Re: [PATCH 3/3] md: Add support for Raid0->Raid10 takeover

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, 29 Jan 2010 14:54:21 +0000
"Trela, Maciej" <Maciej.Trela@xxxxxxxxx> 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

--
To unsubscribe from this list: send the line "unsubscribe linux-raid" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux RAID Wiki]     [ATA RAID]     [Linux SCSI Target Infrastructure]     [Linux Block]     [Linux IDE]     [Linux SCSI]     [Linux Hams]     [Device Mapper]     [Device Mapper Cryptographics]     [Kernel]     [Linux Admin]     [Linux Net]     [GFS]     [RPM]     [git]     [Yosemite Forum]


  Powered by Linux