]> git.ipfire.org Git - thirdparty/mdadm.git/commitdiff
Assemble: don't assemble IMSM array without OROM.
authorNeilBrown <neilb@suse.com>
Wed, 29 Jul 2015 04:38:37 +0000 (14:38 +1000)
committerNeilBrown <neilb@suse.com>
Wed, 29 Jul 2015 04:38:37 +0000 (14:38 +1000)
If someone has an IMSM array, and disables RAID in the BIOS
and uses the devices for some other purpose, then they really don't
want mdadm to start syncing the array.

So don't assemble if OROM doesn't confirm it is OK.

There can still be problems for crash-dump not being able to find
the OROM.   Some explicit work-around might be needed for that
rather than a more general workaround that can corrupt data.

Signed-off-by: NeilBrown <neilb@suse.com>
Assemble.c
Incremental.c

index 8940c27583a91cb5a4b9f5047db2b00d3f2eee44..4275fad68849920e98bf3a22e44a3201868d5e78 100644 (file)
@@ -1343,7 +1343,7 @@ try_again:
                       mddev ? mddev : "further assembly");
 
        content = &info;
-       if (st)
+       if (st && c->force)
                st->ignore_hw_compat = 1;
        num_devs = select_devices(devlist, ident, &st, &content, c,
                                  inargv, auto_assem);
index 3f3b4d9dfa39ddef7eb49f8fc20c7499e835b56a..be581a518a74b9ef72d69d94c64423f3ff7c9155 100644 (file)
@@ -130,8 +130,6 @@ int Incremental(struct mddev_dev *devlist, 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);
 
@@ -204,7 +202,8 @@ int Incremental(struct mddev_dev *devlist, struct context *c,
                               NULL, c->verbose);
                goto out;
        }
-       st->ignore_hw_compat = 1;
+       st->ignore_hw_compat = 0;
+
        if (st->ss->compare_super == NULL ||
            st->ss->load_super(st, dfd, NULL)) {
                if (c->verbose >= 0)
@@ -1128,6 +1127,7 @@ static int partition_try_spare(char *devname, int *dfdp, struct dev_policy *pol,
                if (st2 == NULL ||
                    st2->ss->load_super(st2, fd, NULL) < 0)
                        goto next;
+               st2->ignore_hw_compat = 0;
 
                if (!st) {
                        /* Check domain policy again, this time referring to metadata */
@@ -1354,8 +1354,7 @@ restart:
                        struct supertype *st = super_by_fd(mdfd, NULL);
                        int ret = 0;
                        struct map_ent *map = NULL;
-                       if (st)
-                               st->ignore_hw_compat = 1;
+
                        if (st && st->ss->load_container)
                                ret = st->ss->load_container(st, mdfd, NULL);
                        close(mdfd);