]> git.ipfire.org Git - thirdparty/mdadm.git/commitdiff
IMSM - allow assembling any imsm array even without OROM.
authorNeilBrown <neilb@suse.de>
Tue, 30 Oct 2012 03:28:25 +0000 (14:28 +1100)
committerNeilBrown <neilb@suse.de>
Tue, 20 Nov 2012 01:07:30 +0000 (12:07 +1100)
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>
Assemble.c
Incremental.c
super-intel.c
util.c

index 94e314b78040190faec3d6c1fd9d20546123f1d3..dbac9aecfb0bd96a9ce87b1f15ccc4d0ddfb4dd1 100644 (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)
index 4c889b5f257bc1734b08ae5c288f5150f1430766..bc23a885d5e404358646eb2f4a5b0c8d35b40336 100644 (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)
index 452fae4ce4ce81272ac688a500bf3ec00be8cc6a..202b83fcbaf2d4fd6c00064edfc94553bd03127e 100644 (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 */
diff --git a/util.c b/util.c
index 498162f0da4cf61c9e7854d8f8eb969222c30dfb..6c10365e80c99a39e55111af98b5ccc4e40c5296 100644 (file)
--- a/util.c
+++ b/util.c
@@ -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;
                }
        }