diff options
author | Adam Kwolek <adam.kwolek@intel.com> | 2011-06-09 13:00:55 +1000 |
---|---|---|
committer | NeilBrown <neilb@suse.de> | 2011-06-09 13:00:55 +1000 |
commit | e13ce846aa4b01475640cbf63650fa775c82cac6 (patch) | |
tree | 1f862e0261cdf93cd2c471613f827974c0b890f1 | |
parent | 3ef4403cf63ea353c37fb34cf366ad1a0d146269 (diff) | |
download | mdadm-e13ce846aa4b01475640cbf63650fa775c82cac6.tar.gz |
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>
-rw-r--r-- | super-intel.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/super-intel.c b/super-intel.c index b2142b9..3f0fd85 100644 --- a/super-intel.c +++ b/super-intel.c @@ -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) { |