]> git.ipfire.org Git - thirdparty/mdadm.git/commitdiff
Grow: disallow --size changes on RAID0 and Linear.
authorNeilBrown <neilb@suse.de>
Thu, 21 Feb 2013 03:51:11 +0000 (14:51 +1100)
committerNeilBrown <neilb@suse.de>
Thu, 21 Feb 2013 03:51:11 +0000 (14:51 +1100)
These aren't meaningful and must be disabled.

Signed-off-by: NeilBrown <neilb@suse.de>
Grow.c

diff --git a/Grow.c b/Grow.c
index 957710a5598fd41e4f47313a54ce41f16e1776ca..1ab6f4064a37a9a6092a7dd04acdeb8d7d193305 100644 (file)
--- 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;