]> git.ipfire.org Git - thirdparty/mdadm.git/blobdiff - Create.c
Make sure resync_start is initialised properly and maintained properly
[thirdparty/mdadm.git] / Create.c
index bef221ad61deb37cea10e70d73f573130663f833..b2edc7d6e7bcada0514854cc498fe105865f9ec9 100644 (file)
--- a/Create.c
+++ b/Create.c
@@ -448,11 +448,13 @@ int Create(struct supertype *st, char *mddev, int mdfd,
             ( level <= 0 )
             ||
             assume_clean
-               )
+               ) {
                info.array.state = 1; /* clean, but one+ drive will be missing*/
-       else
+               info.resync_start = ~0ULL;
+       } else {
                info.array.state = 0; /* not clean, but no errors */
-
+               info.resync_start = 0;
+       }
        if (level == 10) {
                /* for raid10, the bitmap size is the capacity of the array,
                 * which is array.size * raid_disks / ncopies;
@@ -767,7 +769,7 @@ int Create(struct supertype *st, char *mddev, int mdfd,
                if (verbose >= 0)
                        fprintf(stderr, Name ": array %s started.\n", mddev);
                if (st->ss->external && st->subarray[0]) {
-                       if (need_mdmon) {
+                       if (need_mdmon && !env_no_mdmon()) {
                                int dn = st->container_dev;
                                int i;
                                switch(fork()) {