From: Labun, Marcin Date: Thu, 10 Mar 2011 00:50:57 +0000 (+1100) Subject: imsm: verify that component disks are attached to the same type of HBA X-Git-Tag: mdadm-3.2.1~56 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8603ea6f221478067e1f50cf1b4d54661403911b;p=thirdparty%2Fmdadm.git imsm: verify that component disks are attached to the same type of HBA 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 Signed-off-by: NeilBrown --- diff --git a/super-intel.c b/super-intel.c index 663ce2df..3dc89991 100644 --- a/super-intel.c +++ b/super-intel.c @@ -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