From: NeilBrown Date: Tue, 30 Oct 2012 02:34:54 +0000 (+1100) Subject: Grow: fix reshape from RAID5 to RAID1. X-Git-Tag: mdadm-3.3-rc1~156 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6a67848ab6dc389634673fda3ec867539a763f38;p=thirdparty%2Fmdadm.git Grow: fix reshape from RAID5 to RAID1. Commit 5da9ab9874cb5896023afae1462550d83a869831 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 --- diff --git a/Grow.c b/Grow.c index 4de80299..205110cc 100644 --- a/Grow.c +++ b/Grow.c @@ -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"; } diff --git a/sysfs.c b/sysfs.c index a7ff38a4..b66cebf3 100644 --- a/sysfs.c +++ b/sysfs.c @@ -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");