From 90b60dfa48592e0118065060e91c8c498075a344 Mon Sep 17 00:00:00 2001 From: NeilBrown Date: Wed, 8 Jun 2011 16:56:41 +1000 Subject: [PATCH] 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 --- Grow.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Grow.c b/Grow.c index 7a8ffdb..ad5ccc4 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