Grow: fix reshape from RAID5 to RAID1.

Commit 5da9ab9874
       Grow_reshape re-factor
in mdadm-3.2 broke conversion from RAID5 and RAID1 - and we
never noticed.

This fixes it.

Signed-off-by: NeilBrown <neilb@suse.de>
This commit is contained in:
NeilBrown 2012-10-30 13:34:54 +11:00
parent 4610608a02
commit 6a67848ab6
2 changed files with 7 additions and 3 deletions

4
Grow.c
View File

@ -1281,7 +1281,9 @@ char *analyse_change(struct mdinfo *info, struct reshape *re)
return "Cannot set raid_disk when "
"converting RAID5->RAID1";
re->level = 1;
break;
re->backup_blocks = 0;
info->new_chunk = 0;
return NULL;
default:
return "Impossible level change requested";
}

View File

@ -176,8 +176,10 @@ struct mdinfo *sysfs_read(int fd, int devnum, unsigned long options)
if (options & GET_CACHE) {
strcpy(base, "stripe_cache_size");
if (load_sys(fname, buf))
goto abort;
sra->cache_size = strtoul(buf, NULL, 0);
/* Probably level doesn't support it */
sra->cache_size = 0;
else
sra->cache_size = strtoul(buf, NULL, 0);
}
if (options & GET_MISMATCH) {
strcpy(base, "mismatch_cnt");