diff options
author | NeilBrown <neilb@suse.de> | 2011-06-08 16:56:41 +1000 |
---|---|---|
committer | NeilBrown <neilb@suse.de> | 2011-06-08 16:56:41 +1000 |
commit | 90b60dfa48592e0118065060e91c8c498075a344 (patch) | |
tree | 3041922bc4cd9d2c33bd33f5b9d0f818b71ec41a | |
parent | e2f41b2c6a8f97df211add545ed25b9e2bbb302b (diff) | |
download | mdadm-90b60dfa48592e0118065060e91c8c498075a344.tar.gz |
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>
-rw-r--r-- | Grow.c | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -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 |