]> git.ipfire.org Git - thirdparty/mdadm.git/blobdiff - super1.c
Remove .sock file when removing .pid file for mdmon
[thirdparty/mdadm.git] / super1.c
index 06d0a1876cf1f678f27661c14dfc8649576d8c89..b7cd962a7e375de6c0c7667749ccf60acaffc88e 100644 (file)
--- a/super1.c
+++ b/super1.c
@@ -456,12 +456,6 @@ static void export_detail_super1(struct supertype *st)
                }
        if (len)
                printf("MD_NAME=%.*s\n", len, sb->set_name);
-       printf("MD_UUID=");
-       for (i=0; i<16; i++) {
-               if ((i&3)==0 && i != 0) printf(":");
-               printf("%02x", sb->set_uuid[i]);
-       }
-       printf("\n");
 }
 
 #endif
@@ -532,6 +526,7 @@ static void getinfo_super1(struct supertype *st, struct mdinfo *info)
        }
        info->events = __le64_to_cpu(sb->events);
        sprintf(info->text_version, "1.%d", st->minor_version);
+       info->safe_mode_delay = 200;
 
        memcpy(info->uuid, sb->set_uuid, 16);
 
@@ -776,6 +771,7 @@ struct devinfo {
        mdu_disk_info_t disk;
        struct devinfo *next;
 };
+#ifndef MDASSEMBLE
 /* Add a device to the superblock being created */
 static void add_to_super1(struct supertype *st, mdu_disk_info_t *dk,
                          int fd, char *devname)
@@ -804,6 +800,7 @@ static void add_to_super1(struct supertype *st, mdu_disk_info_t *dk,
        di->next = NULL;
        *dip = di;
 }
+#endif
 
 static void locate_bitmap1(struct supertype *st, int fd);
 
@@ -1229,15 +1226,21 @@ static struct supertype *match_metadata_desc1(char *arg)
        st->ss = &super1;
        st->max_devs = 384;
        st->sb = NULL;
-       if (strcmp(arg, "1.0") == 0) {
+       /* leading zeros can be safely ignored.  --detail generates them. */
+       while (*arg == '0')
+               arg++;
+       if (strcmp(arg, "1.0") == 0 ||
+           strcmp(arg, "1.00") == 0) {
                st->minor_version = 0;
                return st;
        }
-       if (strcmp(arg, "1.1") == 0) {
+       if (strcmp(arg, "1.1") == 0 ||
+           strcmp(arg, "1.01") == 0) {
                st->minor_version = 1;
                return st;
        }
-       if (strcmp(arg, "1.2") == 0) {
+       if (strcmp(arg, "1.2") == 0 ||
+           strcmp(arg, "1.02") == 0) {
                st->minor_version = 2;
                return st;
        }
@@ -1462,6 +1465,7 @@ static void free_super1(struct supertype *st)
        st->sb = NULL;
 }
 
+#ifndef MDASSEMBLE
 static int validate_geometry1(struct supertype *st, int level,
                              int layout, int raiddisks,
                              int chunk, unsigned long long size,
@@ -1493,6 +1497,7 @@ static int validate_geometry1(struct supertype *st, int level,
        *freesize = avail_size1(st, ldsize >> 9);
        return 1;
 }
+#endif /* MDASSEMBLE */
 
 struct superswitch super1 = {
 #ifndef MDASSEMBLE
@@ -1503,13 +1508,14 @@ struct superswitch super1 = {
        .brief_detail_super = brief_detail_super1,
        .export_detail_super = export_detail_super1,
        .write_init_super = write_init_super1,
+       .validate_geometry = validate_geometry1,
+       .add_to_super = add_to_super1,
 #endif
        .match_home = match_home1,
        .uuid_from_super = uuid_from_super1,
        .getinfo_super = getinfo_super1,
        .update_super = update_super1,
        .init_super = init_super1,
-       .add_to_super = add_to_super1,
        .store_super = store_super1,
        .compare_super = compare_super1,
        .load_super = load_super1,
@@ -1519,7 +1525,6 @@ struct superswitch super1 = {
        .locate_bitmap = locate_bitmap1,
        .write_bitmap = write_bitmap1,
        .free_super = free_super1,
-       .validate_geometry = validate_geometry1,
 #if __BYTE_ORDER == BIG_ENDIAN
        .swapuuid = 0,
 #else