]> git.ipfire.org Git - thirdparty/mdadm.git/commitdiff
imsm: FIX: Check layout for level migration
authorAdam Kwolek <adam.kwolek@intel.com>
Thu, 9 Jun 2011 03:00:55 +0000 (13:00 +1000)
committerNeilBrown <neilb@suse.de>
Thu, 9 Jun 2011 03:00:55 +0000 (13:00 +1000)
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>
super-intel.c

index b2142b974c147b8f131b3b7912e5d69c8a9b6ef9..3f0fd853807650d7c3fca684f1f6a4427912ef42 100644 (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) {