From: NeilBrown Date: Wed, 8 Jun 2011 06:56:41 +0000 (+1000) Subject: Grow: Add paranoid level checking to analyse_change. X-Git-Tag: mdadm-3.2.2~61 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=90b60dfa48592e0118065060e91c8c498075a344;p=thirdparty%2Fmdadm.git Grow: Add paranoid level checking to analyse_change. 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 --- diff --git a/Grow.c b/Grow.c index 7a8ffdbc..ad5ccc45 100644 --- 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