]> git.ipfire.org Git - thirdparty/mdadm.git/blobdiff - config.c
config: support "ARRAY <ignore> ..." lines in mdadm.conf
[thirdparty/mdadm.git] / config.c
index 8b2335594cd21e7cfa4153f0dc90ae33a721e8bb..66c3964ff3e7c579d6f9eba5e33b3b04dfbbe83d 100644 (file)
--- a/config.c
+++ b/config.c
@@ -261,6 +261,7 @@ mddev_dev_t load_partitions(void)
                d->devname = strdup(name);
                d->next = rv;
                d->used = 0;
+               d->content = NULL;
                rv = d;
        }
        fclose(f);
@@ -290,6 +291,7 @@ mddev_dev_t load_containers(void)
                        }
                        d->next = rv;
                        d->used = 0;
+                       d->content = NULL;
                        rv = d;
                }
        free_mdstat(mdstat);
@@ -469,7 +471,7 @@ void arrayline(char *line)
        mis.member = NULL;
 
        for (w=dl_next(line); w!=line; w=dl_next(w)) {
-               if (w[0] == '/') {
+               if (w[0] == '/' || strcasecmp(w, "<ignore>") == 0) {
                        if (mis.devname)
                                fprintf(stderr, Name ": only give one device per ARRAY line: %s and %s\n",
                                        mis.devname, w);
@@ -561,7 +563,9 @@ void arrayline(char *line)
                                w);
                }
        }
-       if (mis.uuid_set == 0 && mis.devices == NULL && mis.super_minor == UnSet && mis.name[0] == 0)
+       if (mis.uuid_set == 0 && mis.devices == NULL &&
+           mis.super_minor == UnSet && mis.name[0] == 0 &&
+           (mis.container == NULL && mis.member == NULL))
                fprintf(stderr, Name ": ARRAY line %s has no identity information.\n", mis.devname);
        else {
                mi = malloc(sizeof(*mi));
@@ -598,7 +602,7 @@ void mailfromline(char *line)
                else {
                        char *t = NULL;
 
-                       if (asprintf(&t, "%s %s", alert_mail_from, w) > 0) {
+                       if (xasprintf(&t, "%s %s", alert_mail_from, w) > 0) {
                                free(alert_mail_from);
                                alert_mail_from = t;
                        }
@@ -803,6 +807,7 @@ mddev_dev_t conf_get_devs()
                        t->devname = strdup(globbuf.gl_pathv[i]);
                        t->next = dlist;
                        t->used = 0;
+                       t->content = NULL;
                        dlist = t;
 /*     printf("one dev is %s\n", t->devname);*/
                }