imsm: FIX: Check layout for level migration

When user doesn't specify raid 5 layout for raid0->rai5 migration,
layout structure member is uninitialized. Earlier it cannot be determined
if it is correct or not.
In metadata handle proper verification is placed.

Signed-off-by: Adam Kwolek <adam.kwolek@intel.com>
Signed-off-by: Krzysztof Wojcik <krzysztof.wojcik@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
This commit is contained in:
Adam Kwolek 2011-06-09 13:00:55 +10:00 committed by NeilBrown
parent 3ef4403cf6
commit e13ce846aa
1 changed files with 8 additions and 1 deletions

View File

@ -8277,7 +8277,6 @@ enum imsm_reshape_type imsm_analyze_change(struct supertype *st,
int chunk;
getinfo_super_imsm_volume(st, &info, NULL);
if ((geo->level != info.array.level) &&
(geo->level >= 0) &&
(geo->level != UnSet)) {
@ -8285,6 +8284,14 @@ enum imsm_reshape_type imsm_analyze_change(struct supertype *st,
case 0:
if (geo->level == 5) {
change = CH_MIGRATION;
if (geo->layout != ALGORITHM_LEFT_ASYMMETRIC) {
fprintf(stderr,
Name " Error. Requested Layout "
"not supported (left-asymmetric layout "
"is supported only)!\n");
change = -1;
goto analyse_change_exit;
}
check_devs = 1;
}
if (geo->level == 10) {