aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMaciej Trela <maciej.trela@intel.com>2010-06-16 06:46:29 -0400
committerNeilBrown <neilb@suse.de>2010-06-23 23:33:51 -0400
commitf73ea87375a1b2bf6c0be82bb9a3cb9d5ee7a407 (patch)
treec6353ca45235a258cf7d72ecb1b29d6babfcd2fc
parente93f68a1fc6244c05ad8fae28e75835ec74ab34e (diff)
md: fix raid10 takeover: use new_layout for setup_conf
Use mddev->new_layout in setup_conf. Also use new_chunk, and don't set ->degraded in takeover(). That gets set in run() Signed-off-by: Maciej Trela <maciej.trela@intel.com> Signed-off-by: NeilBrown <neilb@suse.de>
-rw-r--r--drivers/md/raid10.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/drivers/md/raid10.c b/drivers/md/raid10.c
index 1bab3559f3e2..42e64e4e5e25 100644
--- a/drivers/md/raid10.c
+++ b/drivers/md/raid10.c
@@ -2161,22 +2161,22 @@ static conf_t *setup_conf(mddev_t *mddev)
2161 sector_t stride, size; 2161 sector_t stride, size;
2162 int err = -EINVAL; 2162 int err = -EINVAL;
2163 2163
2164 if (mddev->chunk_sectors < (PAGE_SIZE >> 9) || 2164 if (mddev->new_chunk_sectors < (PAGE_SIZE >> 9) ||
2165 !is_power_of_2(mddev->chunk_sectors)) { 2165 !is_power_of_2(mddev->new_chunk_sectors)) {
2166 printk(KERN_ERR "md/raid10:%s: chunk size must be " 2166 printk(KERN_ERR "md/raid10:%s: chunk size must be "
2167 "at least PAGE_SIZE(%ld) and be a power of 2.\n", 2167 "at least PAGE_SIZE(%ld) and be a power of 2.\n",
2168 mdname(mddev), PAGE_SIZE); 2168 mdname(mddev), PAGE_SIZE);
2169 goto out; 2169 goto out;
2170 } 2170 }
2171 2171
2172 nc = mddev->layout & 255; 2172 nc = mddev->new_layout & 255;
2173 fc = (mddev->layout >> 8) & 255; 2173 fc = (mddev->new_layout >> 8) & 255;
2174 fo = mddev->layout & (1<<16); 2174 fo = mddev->new_layout & (1<<16);
2175 2175
2176 if ((nc*fc) <2 || (nc*fc) > mddev->raid_disks || 2176 if ((nc*fc) <2 || (nc*fc) > mddev->raid_disks ||
2177 (mddev->layout >> 17)) { 2177 (mddev->new_layout >> 17)) {
2178 printk(KERN_ERR "md/raid10:%s: unsupported raid10 layout: 0x%8x\n", 2178 printk(KERN_ERR "md/raid10:%s: unsupported raid10 layout: 0x%8x\n",
2179 mdname(mddev), mddev->layout); 2179 mdname(mddev), mddev->new_layout);
2180 goto out; 2180 goto out;
2181 } 2181 }
2182 2182
@@ -2435,7 +2435,6 @@ static void *raid10_takeover_raid0(mddev_t *mddev)
2435 mddev->new_layout = (1<<8) + 2; 2435 mddev->new_layout = (1<<8) + 2;
2436 mddev->new_chunk_sectors = mddev->chunk_sectors; 2436 mddev->new_chunk_sectors = mddev->chunk_sectors;
2437 mddev->delta_disks = mddev->raid_disks; 2437 mddev->delta_disks = mddev->raid_disks;
2438 mddev->degraded = mddev->raid_disks;
2439 mddev->raid_disks *= 2; 2438 mddev->raid_disks *= 2;
2440 /* make sure it will be not marked as dirty */ 2439 /* make sure it will be not marked as dirty */
2441 mddev->recovery_cp = MaxSector; 2440 mddev->recovery_cp = MaxSector;