]> git.ipfire.org Git - thirdparty/mdadm.git/blobdiff - Assemble.c
Add --offroot argument to mdadm
[thirdparty/mdadm.git] / Assemble.c
index 74708d158e55d23736650ca81db770f676a6f5c8..fd9446190f7095be870ba080f2498ebe52662584 100644 (file)
@@ -220,7 +220,9 @@ int Assemble(struct supertype *st, char *mddev,
        int change = 0;
        int inargv = 0;
        int report_missmatch;
+#ifndef MDASSEMBLE
        int bitmap_done;
+#endif
        int start_partial_ok = (runstop >= 0) && 
                (force || devlist==NULL || auto_assem);
        unsigned int num_devs;
@@ -701,10 +703,9 @@ int Assemble(struct supertype *st, char *mddev,
                close(mdfd);
                return err;
        }
+       bitmap_done = 0;
 #endif
        /* Ok, no bad inconsistancy, we can try updating etc */
-       bitmap_done = 0;
-       content->update_private = NULL;
        devices = malloc(num_devs * sizeof(*devices));
        devmap = calloc(num_devs * content->array.raid_disks, 1);
        for (tmpdev = devlist; tmpdev; tmpdev=tmpdev->next) if (tmpdev->used == 1) {
@@ -889,8 +890,6 @@ int Assemble(struct supertype *st, char *mddev,
                }
                devcnt++;
        }
-       free(content->update_private);
-       content->update_private = NULL;
 
        if (devcnt == 0) {
                fprintf(stderr, Name ": no devices found for %s\n",
@@ -1615,12 +1614,14 @@ int assemble_container_content(struct supertype *st, int mdfd,
                if (verbose >= 0) {
                        if (err)
                                fprintf(stderr, Name
-                                       ": array %s now has %d devices",
-                                       chosen_name, working + preexist);
+                                       ": array %s now has %d device%s",
+                                       chosen_name, working + preexist,
+                                       working + preexist == 1 ? "":"s");
                        else
                                fprintf(stderr, Name
-                                       ": Started %s with %d devices",
-                                       chosen_name, working + preexist);
+                                       ": Started %s with %d device%s",
+                                       chosen_name, working + preexist,
+                                       working + preexist == 1 ? "":"s");
                        if (preexist)
                                fprintf(stderr, " (%d new)", working);
                        if (expansion)
@@ -1633,11 +1634,15 @@ int assemble_container_content(struct supertype *st, int mdfd,
                return err;
                /* FIXME should have an O_EXCL and wait for read-auto */
        } else {
-               if (verbose >= 0)
+               if (verbose >= 0) {
                        fprintf(stderr, Name
-                               ": %s assembled with %d devices but "
-                               "not started\n",
-                               chosen_name, working);
+                               ": %s assembled with %d device%s",
+                               chosen_name, preexist + working,
+                               preexist + working == 1 ? "":"s");
+                       if (preexist)
+                               fprintf(stderr, " (%d new)", working);
+                       fprintf(stderr, " but not started\n");
+               }
                return 1;
        }
 }