From: NeilBrown Date: Thu, 21 Feb 2013 03:51:11 +0000 (+1100) Subject: Grow: disallow --size changes on RAID0 and Linear. X-Git-Tag: mdadm-3.3-rc1~119 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3920235ea20bf32be8fc3c830ebca3f83eea671a;p=thirdparty%2Fmdadm.git Grow: disallow --size changes on RAID0 and Linear. These aren't meaningful and must be disabled. Signed-off-by: NeilBrown --- diff --git a/Grow.c b/Grow.c index 957710a5..1ab6f406 100644 --- a/Grow.c +++ b/Grow.c @@ -1703,6 +1703,12 @@ int Grow_reshape(char *devname, int fd, if (orig_size == 0) orig_size = (unsigned) array.size; + if (orig_size == 0) { + pr_err("Cannot set device size in this type of array.\n"); + rv = 1; + goto release; + } + if (reshape_super(st, s->size, UnSet, UnSet, 0, 0, UnSet, NULL, devname, APPLY_METADATA_CHANGES, c->verbose > 0)) { rv = 1;