From 3920235ea20bf32be8fc3c830ebca3f83eea671a Mon Sep 17 00:00:00 2001 From: NeilBrown Date: Thu, 21 Feb 2013 14:51:11 +1100 Subject: [PATCH] Grow: disallow --size changes on RAID0 and Linear. These aren't meaningful and must be disabled. Signed-off-by: NeilBrown --- Grow.c | 6 ++++++ 1 file changed, 6 insertions(+) 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; -- 2.47.2