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 <neilb@suse.de>
This commit is contained in:
NeilBrown 2011-06-08 16:56:41 +10:00
parent e2f41b2c6a
commit 90b60dfa48
1 changed files with 2 additions and 0 deletions

2
Grow.c
View File

@ -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