]> git.ipfire.org Git - thirdparty/mdadm.git/commitdiff
Grow: Add paranoid level checking to analyse_change.
authorNeilBrown <neilb@suse.de>
Wed, 8 Jun 2011 06:56:41 +0000 (16:56 +1000)
committerNeilBrown <neilb@suse.de>
Wed, 8 Jun 2011 06:56:41 +0000 (16:56 +1000)
Just in case array.level is ever something that we don't expect, make
sure we report an error clearly rather than get confused.

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

diff --git a/Grow.c b/Grow.c
index 7a8ffdbc759cb6d57d4250854c1eb3edebf9dd24..ad5ccc45c08688d11ee110bc819367eed332e9cf 100644 (file)
--- a/Grow.c
+++ b/Grow.c
@@ -929,6 +929,8 @@ char *analyse_change(struct mdinfo *info, struct reshape *re)
                info->new_chunk = info->array.chunk_size;
 
        switch (info->array.level) {
+       default:
+               return "Cannot understand this RAID level";
        case 1:
                /* RAID1 can convert to RAID1 with different disks, or
                 * raid5 with 2 disks, or