]> git.ipfire.org Git - thirdparty/mdadm.git/commitdiff
imsm: verify that component disks are attached to the same type of HBA
authorLabun, Marcin <Marcin.Labun@intel.com>
Thu, 10 Mar 2011 00:50:57 +0000 (11:50 +1100)
committerNeilBrown <neilb@suse.de>
Thu, 10 Mar 2011 00:50:57 +0000 (11:50 +1100)
compare_super_imsm verifies that the component disks use the same type of HBA
in platform dependent environment. Otherwise print-out error message and block
the action.

Signed-off-by: Marcin Labun <marcin.labun@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
super-intel.c

index 663ce2df4f8d9df60aa13da9f61ce6f3ebabd994..3dc89991b83053e8d9f265a75ac96425a39722bd 100644 (file)
@@ -2207,6 +2207,18 @@ static int compare_super_imsm(struct supertype *st, struct supertype *tst)
                 tst->sb = NULL;
                 return 0;
         }
+       /* in platform dependent environment test if the disks
+        * use the same Intel hba
+        */
+       if (!check_env("IMSM_NO_PLATFORM")) {
+               if (first->hba->type != sec->hba->type)  {
+                       fprintf(stderr,
+                               "HBAs of devices does not match %s != %s\n",
+                               get_sys_dev_type(first->hba->type),
+                               get_sys_dev_type(sec->hba->type));
+                       return 3;
+               }
+       }
 
        /* if an anchor does not have num_raid_devs set then it is a free
         * floating spare