]> git.ipfire.org Git - thirdparty/mdadm.git/blobdiff - mdadm.c
Stop managed arrays more carefully.
[thirdparty/mdadm.git] / mdadm.c
diff --git a/mdadm.c b/mdadm.c
index 67823d50059a9b273534b5d48a2fc605aed6b025..8b4b5dffbacceb81dbb05fb7e438ead3052abecc 100644 (file)
--- a/mdadm.c
+++ b/mdadm.c
@@ -1100,11 +1100,12 @@ int main(int argc, char *argv[])
                                int acnt;
                                ident.autof = autof;
                                do {
+                                       mddev_dev_t devlist = conf_get_devs();
                                        acnt = 0;
                                        do {
                                                rv2 = Assemble(ss, NULL, -1,
                                                               &ident,
-                                                              NULL, NULL,
+                                                              devlist, NULL,
                                                               readonly, runstop, NULL, homehost, verbose-quiet, force);
                                                if (rv2==0) {
                                                        cnt++;
@@ -1138,7 +1139,8 @@ int main(int argc, char *argv[])
                                if (cnt == 0 && rv == 0) {
                                        fprintf(stderr, Name ": No arrays found in config file or automatically\n");
                                        rv = 1;
-                               }
+                               } else if (cnt)
+                                       rv = 0;
                        } else if (cnt == 0 && rv == 0) {
                                fprintf(stderr, Name ": No arrays found in config file\n");
                                rv = 1;
@@ -1270,7 +1272,8 @@ int main(int argc, char *argv[])
                                                     export, test, homehost);
                                        continue;
                                case 'K': /* Zero superblock */
-                                       rv |= Kill(dv->devname, force, quiet); continue;
+                                       rv |= Kill(dv->devname, force, quiet,0);
+                                       continue;
                                case 'Q':
                                        rv |= Query(dv->devname); continue;
                                case 'X':