]> git.ipfire.org Git - thirdparty/mdadm.git/blobdiff - super1.c
imsm: no need to report the component device name from container_content
[thirdparty/mdadm.git] / super1.c
index 667154d139b343b19c407d4d9d12323e7a4c72b7..2c992a4b1590f7198c10aed8555a3130ad9ec85c 100644 (file)
--- a/super1.c
+++ b/super1.c
@@ -1016,8 +1016,8 @@ static int write_init_super1(struct supertype *st)
                if (di->fd < 0)
                        continue;
 
-               Kill(di->devname, 0, 1, 1);
-               Kill(di->devname, 0, 1, 1);
+               while (Kill(di->devname, NULL, 0, 1, 1) == 0)
+                       ;
 
                sb->dev_number = __cpu_to_le32(di->disk.number);
                if (di->disk.state & (1<<MD_DISK_WRITEMOSTLY))
@@ -1351,7 +1351,10 @@ static struct supertype *match_metadata_desc1(char *arg)
                return st;
        }
        if (strcmp(arg, "1.1") == 0 ||
-           strcmp(arg, "1.01") == 0) {
+           strcmp(arg, "1.01") == 0 ||
+           strcmp(arg, "default") == 0 ||
+           strcmp(arg, "") == 0 /* no metadata */
+               ) {
                st->minor_version = 1;
                return st;
        }
@@ -1498,9 +1501,14 @@ add_internal_bitmap1(struct supertype *st,
                min_chunk *= 2;
                bits = (bits+1)/2;
        }
-       if (chunk == UnSet)
+       if (chunk == UnSet) {
+               /* For practical purpose, 64Meg is a good
+                * default chunk size for internal bitmaps.
+                */
                chunk = min_chunk;
-       else if (chunk < min_chunk)
+               if (chunk < 64*1024*1024)
+                       chunk = 64*1024*1024;
+       } else if (chunk < min_chunk)
                return 0; /* chunk size too small */
        if (chunk == 0) /* rounding problem */
                return 0;
@@ -1601,8 +1609,11 @@ static int validate_geometry1(struct supertype *st, int level,
        unsigned long long ldsize;
        int fd;
 
-       if (level == LEVEL_CONTAINER)
+       if (level == LEVEL_CONTAINER) {
+               if (verbose)
+                       fprintf(stderr, Name ": 1.x metadata does not support containers\n");
                return 0;
+       }
        if (!subdev)
                return 1;