]> git.ipfire.org Git - thirdparty/mdadm.git/blobdiff - mdadm.c
Merge branch 'master' into devel-3.0
[thirdparty/mdadm.git] / mdadm.c
diff --git a/mdadm.c b/mdadm.c
index f2a7bcd53d3ec8da5ce13f13bc8b81640974f4b8..d243620ffc4e5f9b8289b3a69828aefa0b8c3f38 100644 (file)
--- a/mdadm.c
+++ b/mdadm.c
@@ -214,6 +214,7 @@ int main(int argc, char *argv[])
                case 'o':
                case 'w':
                case 'W':
+               case Waitclean:
                case 'K': if (!mode) newmode = MISC; break;
                }
                if (mode && newmode == mode) {
@@ -637,6 +638,7 @@ int main(int argc, char *argv[])
                        continue;
 
                case O(ASSEMBLE,'c'): /* config file */
+               case O(INCREMENTAL, 'c'):
                case O(MISC, 'c'):
                case O(MONITOR,'c'):
                        if (configfile) {
@@ -704,7 +706,7 @@ int main(int argc, char *argv[])
                        test = 1;
                        continue;
                case O(MONITOR,'y'): /* log messages to syslog */
-                       openlog("mdadm", 0, SYSLOG_FACILITY);
+                       openlog("mdadm", LOG_PID, SYSLOG_FACILITY);
                        dosyslog = 1;
                        continue;
 
@@ -770,6 +772,7 @@ int main(int argc, char *argv[])
                case O(MISC,'o'):
                case O(MISC,'w'):
                case O(MISC,'W'):
+               case O(MISC, Waitclean):
                        if (devmode && devmode != opt &&
                            (devmode == 'E' || (opt == 'E' && devmode != 'Q'))) {
                                fprintf(stderr, Name ": --examine/-E cannot be given with -%c\n",
@@ -1100,11 +1103,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 +1142,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;
@@ -1153,7 +1158,7 @@ int main(int argc, char *argv[])
                        break;
                }
                if (raiddisks == 0) {
-                       fprintf(stderr, Name ": no raid-disks specified.\n");
+                       fprintf(stderr, Name ": no raid-devices specified.\n");
                        rv = 1;
                        break;
                }
@@ -1177,7 +1182,7 @@ int main(int argc, char *argv[])
                        break;
                }
                if (raiddisks == 0) {
-                       fprintf(stderr, Name ": no raid-disks specified.\n");
+                       fprintf(stderr, Name ": no raid-devices specified.\n");
                        rv = 1;
                        break;
                }
@@ -1202,7 +1207,9 @@ int main(int argc, char *argv[])
                        }
                        if (brief && verbose)
                                brief = 2;
-                       rv = Examine(devlist, scan?(verbose>1?0:verbose+1):brief, scan, SparcAdjust, ss, homehost);
+                       rv = Examine(devlist, scan?(verbose>1?0:verbose+1):brief,
+                                    export, scan,
+                                    SparcAdjust, ss, homehost);
                } else {
                        if (devlist == NULL) {
                                if (devmode=='D' && scan) {
@@ -1268,13 +1275,16 @@ 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':
                                        rv |= ExamineBitmap(dv->devname, brief, ss); continue;
                                case 'W':
                                        rv |= Wait(dv->devname); continue;
+                               case Waitclean:
+                                       rv |= WaitClean(dv->devname, verbose-quiet); continue;
                                }
                                mdfd = open_mddev(dv->devname, 1);
                                if (mdfd>=0) {