diff options
author | Labun, Marcin <Marcin.Labun@intel.com> | 2011-03-23 12:05:53 +1100 |
---|---|---|
committer | NeilBrown <neilb@suse.de> | 2011-03-23 12:05:53 +1100 |
commit | ea2bc72b0049f7d02156bae8f21736ddd93e731e (patch) | |
tree | 32389a7a51077dcecbb980b5aba654378e718fce | |
parent | df3346e675d731b4c847272fc40bb992ace7554e (diff) | |
download | mdadm-ea2bc72b0049f7d02156bae8f21736ddd93e731e.tar.gz |
super-intel: enable loading metadata from non-IMSM compliant disks
Honor ignore_hw_compat to load metadata from disk attached to non-IMSM
controller or when there are no IMSM OROM/EFI capabilities.
Used only for guessing and examining metadata format.
Signed-off-by: Marcin Labun <marcin.labun@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
-rw-r--r-- | super-intel.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/super-intel.c b/super-intel.c index acd7571..2b41e08 100644 --- a/super-intel.c +++ b/super-intel.c @@ -2218,11 +2218,12 @@ static int compare_super_imsm(struct supertype *st, struct supertype *tst) * use the same Intel hba */ if (!check_env("IMSM_NO_PLATFORM")) { - if (first->hba->type != sec->hba->type) { + if (!first->hba || !sec->hba || + (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)); + first->hba ? get_sys_dev_type(first->hba->type) : NULL, + sec->hba ? get_sys_dev_type(sec->hba->type) : NULL); return 3; } } @@ -3386,16 +3387,19 @@ static int load_super_imsm(struct supertype *st, int fd, char *devname) sizeof(*super)); return 1; } + /* Load hba and capabilities if they exist. + * But do not preclude loading metadata in case capabilities or hba are + * non-compliant and ignore_hw_compat is set. + */ rv = find_intel_hba_capability(fd, super, devname); /* no orom/efi or non-intel hba of the disk */ - if (rv != 0) { + if ((rv != 0) && (st->ignore_hw_compat == 0)) { if (devname) fprintf(stderr, Name ": No OROM/EFI properties for %s\n", devname); free_imsm(super); return 2; } - rv = load_and_parse_mpb(fd, super, devname, 0); if (rv) { |