]> git.ipfire.org Git - thirdparty/mdadm.git/blobdiff - Incremental.c
IMSM - allow assembling any imsm array even without OROM.
[thirdparty/mdadm.git] / Incremental.c
index 9b5ac27d60d11e39dbbb40d890ee74e6af9eef6f..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)
@@ -641,6 +644,7 @@ static int count_active(struct supertype *st, struct mdinfo *sra,
        /* count how many devices in sra think they are active */
        struct mdinfo *d;
        int cnt = 0;
+       int replcnt = 0;
        __u64 max_events = 0;
        char *avail = NULL;
        int *best = NULL;
@@ -716,7 +720,8 @@ static int count_active(struct supertype *st, struct mdinfo *sra,
                                best[info.disk.raid_disk] = devnum;
                                st->ss->getinfo_super(st, bestinfo, NULL);
                        }
-               }
+               } else if (info.disk.state & (1<<MD_DISK_REPLACEMENT))
+                       replcnt++;
                st->ss->free_super(st);
        }
        if (!avail)
@@ -743,7 +748,7 @@ static int count_active(struct supertype *st, struct mdinfo *sra,
        }
        free(best);
        free(devmap);
-       return cnt;
+       return cnt + replcnt;
 }
 
 /* test if container has degraded member(s) */