]> git.ipfire.org Git - thirdparty/mdadm.git/blobdiff - Assemble.c
Make sure NOFILE resource limit is big enough.
[thirdparty/mdadm.git] / Assemble.c
index ab7e249eecd5a84ca903db82b6a042adc1fa52e4..b45abc2f408d4ad27ff4f7d55a03af8b51470d62 100644 (file)
@@ -622,9 +622,10 @@ static int load_devices(struct devs *devices, char *devmap,
                                                            ident->uuid_set,
                                                            c->homehost);
                        if (err < 0) {
-                               pr_err("--update=%s not understood"
-                                      " for %s metadata\n",
-                                      c->update, tst->ss->name);
+                               if (err == -1)
+                                       pr_err("--update=%s not understood"
+                                              " for %s metadata\n",
+                                              c->update, tst->ss->name);
                                tst->ss->free_super(tst);
                                free(tst);
                                close(mdfd);
@@ -1617,6 +1618,7 @@ try_again:
                        pr_err(":%s has an active reshape - checking "
                               "if critical section needs to be restored\n",
                               chosen_name);
+               enable_fds(bestcnt/2);
                for (i = 0; i < bestcnt/2; i++) {
                        int j = best[i*2];
                        if (j >= 0) {
@@ -1665,6 +1667,12 @@ try_again:
        /* First, fill in the map, so that udev can find our name
         * as soon as we become active.
         */
+       if (c->update && strcmp(c->update, "metadata")==0) {
+               content->array.major_version = 1;
+               content->array.minor_version = 0;
+               strcpy(content->text_version, "1.0");
+       }
+
        map_update(&map, fd2devnm(mdfd), content->text_version,
                   content->uuid, chosen_name);