]> git.ipfire.org Git - thirdparty/mdadm.git/blobdiff - mdadm.c
imsm: Remove --dump/--restore implementation
[thirdparty/mdadm.git] / mdadm.c
diff --git a/mdadm.c b/mdadm.c
index 1fb8086050eef104a615a1157fa1ca2ce16adbe1..13dc24e4426923c1ba450fc68e47cfdf33498c5c 100644 (file)
--- a/mdadm.c
+++ b/mdadm.c
@@ -550,6 +550,14 @@ int main(int argc, char *argv[])
                                pr_err("raid level must be given before layout.\n");
                                exit(2);
 
+                       case 0:
+                               s.layout = map_name(r0layout, optarg);
+                               if (s.layout == UnSet) {
+                                       pr_err("layout %s not understood for raid0.\n",
+                                               optarg);
+                                       exit(2);
+                               }
+                               break;
                        case 5:
                                s.layout = map_name(r5layout, optarg);
                                if (s.layout == UnSet) {
@@ -787,6 +795,9 @@ int main(int argc, char *argv[])
                                continue;
                        if (strcmp(c.update, "revert-reshape") == 0)
                                continue;
+                       if (strcmp(c.update, "layout-original") == 0 ||
+                           strcmp(c.update, "layout-alternate") == 0)
+                               continue;
                        if (strcmp(c.update, "byteorder") == 0) {
                                if (ss) {
                                        pr_err("must not set metadata type with --update=byteorder.\n");
@@ -817,6 +828,7 @@ int main(int argc, char *argv[])
                "     'summaries', 'homehost', 'home-cluster', 'byteorder', 'devicesize',\n"
                "     'no-bitmap', 'metadata', 'revert-reshape'\n"
                "     'bbl', 'no-bbl', 'force-no-bbl', 'ppl', 'no-ppl'\n"
+               "     'layout-original', 'layout-alternate'\n"
                                );
                        exit(outf == stdout ? 0 : 2);
 
@@ -1473,9 +1485,12 @@ int main(int argc, char *argv[])
                        rv = Manage_stop(devlist->devname, mdfd, c.verbose, 0);
                break;
        case ASSEMBLE:
-               if (devs_found == 1 && ident.uuid_set == 0 &&
-                   ident.super_minor == UnSet && ident.name[0] == 0 &&
-                   !c.scan ) {
+               if (!c.scan && c.runstop == -1) {
+                       pr_err("--no-degraded not meaningful without a --scan assembly.\n");
+                       exit(1);
+               } else if (devs_found == 1 && ident.uuid_set == 0 &&
+                          ident.super_minor == UnSet && ident.name[0] == 0 &&
+                          !c.scan) {
                        /* Only a device has been given, so get details from config file */
                        struct mddev_ident *array_ident = conf_get_ident(devlist->devname);
                        if (array_ident == NULL) {