summaryrefslogtreecommitdiff
path: root/Grow.c
diff options
context:
space:
mode:
authorNeilBrown <neilb@suse.de>2013-02-21 14:51:11 +1100
committerNeilBrown <neilb@suse.de>2013-02-21 14:51:11 +1100
commit3920235ea20bf32be8fc3c830ebca3f83eea671a (patch)
tree20bb2568ac1571bee607aaae7764e260604865e6 /Grow.c
parent2452f13a41d3e6fb00665a2d27fbfbf4f51a7464 (diff)
Grow: disallow --size changes on RAID0 and Linear.
These aren't meaningful and must be disabled. Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'Grow.c')
-rw-r--r--Grow.c6
1 files changed, 6 insertions, 0 deletions
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;