IMSM - allow assembling any imsm array even without OROM.

It is important to check for compatibility with 'platform' or
Option ROM when creating or changing and array.  However there is no
real need when simply assembling the array.

On some systems there are situations where the platform information is
not available.  e.g. on some UEFI systems, UEFI is not available
during 'kdump' handling.  This makes it impossible to assemble
an IMSM array to receive the dump.

So remove the requirements that the platform be visible to assemble
an IMSM array.

Signed-off-by: NeilBrown <neilb@suse.de>
This commit is contained in:
NeilBrown 2012-10-30 14:28:25 +11:00
parent 156044805c
commit cb8f6859d1
4 changed files with 12 additions and 13 deletions

View File

@ -1219,6 +1219,8 @@ try_again:
mddev ? mddev : "further assembly");
content = &info;
if (st)
st->ignore_hw_compat = 1;
num_devs = select_devices(devlist, ident, &st, &content, c,
inargv, auto_assem);
if (num_devs < 0)

View File

@ -127,6 +127,8 @@ int Incremental(char *devname, struct context *c,
if (must_be_container(dfd)) {
if (!st)
st = super_by_fd(dfd, NULL);
if (st)
st->ignore_hw_compat = 1;
if (st && st->ss->load_container)
rv = st->ss->load_container(st, dfd, NULL);
@ -185,6 +187,7 @@ int Incremental(char *devname, struct context *c,
st, c->verbose);
goto out;
}
st->ignore_hw_compat = 1;
if (st->ss->compare_super == NULL ||
st->ss->load_super(st, dfd, NULL)) {
if (c->verbose >= 0)

View File

@ -3069,10 +3069,11 @@ static int compare_super_imsm(struct supertype *st, struct supertype *tst)
}
/* in platform dependent environment test if the disks
* use the same Intel hba
* If not on Intel hba at all, allow anything.
*/
if (!check_env("IMSM_NO_PLATFORM")) {
if (!first->hba || !sec->hba ||
(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",
first->hba ? get_sys_dev_type(first->hba->type) : NULL,
@ -4326,7 +4327,6 @@ static int get_super_block(struct intel_super **super_list, int devnum, char *de
struct intel_super*s = NULL;
char nm[32];
int dfd = -1;
int rv;
int err = 0;
int retry;
@ -4343,13 +4343,7 @@ static int get_super_block(struct intel_super **super_list, int devnum, char *de
goto error;
}
rv = find_intel_hba_capability(dfd, s, devname);
/* no orom/efi or non-intel hba of the disk */
if (rv != 0) {
err = 4;
goto error;
}
find_intel_hba_capability(dfd, s, devname);
err = load_and_parse_mpb(dfd, s, NULL, keep_fd);
/* retry the load if we might have raced against mdmon */

6
util.c
View File

@ -559,8 +559,8 @@ int check_raid(int fd, char *name)
char *level;
struct supertype *st = guess_super(fd);
if (!st) return 0;
st->ignore_hw_compat = 1;
if (!st)
return 0;
st->ss->load_super(st, fd, name);
/* Looks like a raid array .. */
pr_err("%s appears to be part of a raid array:\n",
@ -1077,6 +1077,7 @@ struct supertype *dup_super(struct supertype *orig)
st->ss = orig->ss;
st->max_devs = orig->max_devs;
st->minor_version = orig->minor_version;
st->ignore_hw_compat = orig->ignore_hw_compat;
st->sb = NULL;
st->info = NULL;
return st;
@ -1124,7 +1125,6 @@ struct supertype *guess_super_type(int fd, enum guess_types guess_type)
rv = superlist[bestsuper]->load_super(st, fd, NULL);
if (rv == 0) {
superlist[bestsuper]->free_super(st);
st->ignore_hw_compat = 0;
return st;
}
}