]> git.ipfire.org Git - thirdparty/mdadm.git/blobdiff - Build.c
udev-md-raid-assembly.rules: Skip non-ready devices
[thirdparty/mdadm.git] / Build.c
diff --git a/Build.c b/Build.c
index 1887822cdf52d7c64bca3033cade7dbb8948ceeb..74a440e78965d76c9d1c3d97236593a00b97bcf2 100644 (file)
--- a/Build.c
+++ b/Build.c
@@ -24,9 +24,9 @@
 
 #include "mdadm.h"
 
-#define REGISTER_DEV           _IO (MD_MAJOR, 1)
-#define START_MD               _IO (MD_MAJOR, 2)
-#define STOP_MD                _IO (MD_MAJOR, 3)
+#define REGISTER_DEV           _IO (MD_MAJOR, 1)
+#define START_MD               _IO (MD_MAJOR, 2)
+#define STOP_MD                        _IO (MD_MAJOR, 3)
 
 int Build(char *mddev, struct mddev_dev *devlist,
          struct shape *s, struct context *c)
@@ -115,7 +115,7 @@ int Build(char *mddev, struct mddev_dev *devlist,
        }
        mddev = chosen_name;
 
-       map_update(&map, fd2devnum(mdfd), "none", uuid, chosen_name);
+       map_update(&map, fd2devnm(mdfd), "none", uuid, chosen_name);
        map_unlock(&map);
 
        vers = md_get_version(mdfd);
@@ -154,6 +154,8 @@ int Build(char *mddev, struct mddev_dev *devlist,
                goto abort;
        }
 
+       if (s->bitmap_file && strcmp(s->bitmap_file, "none") == 0)
+               s->bitmap_file = NULL;
        if (s->bitmap_file && s->level <= 0) {
                pr_err("bitmaps not meaningful with level %s\n",
                        map_num(pers, s->level)?:"given");
@@ -190,7 +192,7 @@ int Build(char *mddev, struct mddev_dev *devlist,
                        disk.number = i;
                        disk.raid_disk = i;
                        disk.state = (1<<MD_DISK_SYNC) | (1<<MD_DISK_ACTIVE);
-                       if (dv->writemostly == 1)
+                       if (dv->writemostly == FlagSet)
                                disk.state |= 1<<MD_DISK_WRITEMOSTLY;
                        disk.major = major(stb.st_rdev);
                        disk.minor = minor(stb.st_rdev);
@@ -252,8 +254,7 @@ int Build(char *mddev, struct mddev_dev *devlist,
                        pr_err("RUN_ARRAY failed: %s\n",
                                strerror(errno));
                        if (s->chunk & (s->chunk-1)) {
-                               cont_err("Problem may be that chunk size"
-                                        " is not a power of 2\n");
+                               cont_err("Problem may be that chunk size is not a power of 2\n");
                        }
                        goto abort;
                }