]> git.ipfire.org Git - thirdparty/mdadm.git/blobdiff - super0.c
(no commit message)
[thirdparty/mdadm.git] / super0.c
index 9f78b9452dec9e04792760500310769a0b277258..5c6b7d71984e831ba0b9640e04b0f6093aa85022 100644 (file)
--- a/super0.c
+++ b/super0.c
@@ -372,6 +372,7 @@ static void getinfo_super0(struct supertype *st, struct mdinfo *info)
 
        uuid_from_super0(st, info->uuid);
 
+       info->recovery_start = MaxSector;
        if (sb->minor_version > 90 && (sb->reshape_position+1) != 0) {
                info->reshape_active = 1;
                info->reshape_progress = sb->reshape_position;
@@ -725,8 +726,8 @@ static int write_init_super0(struct supertype *st)
                        continue;
                if (di->fd == -1)
                        continue;
-               Kill(di->devname, 0, 1, 1);
-               Kill(di->devname, 0, 1, 1);
+               while (Kill(di->devname, NULL, 0, 1, 1) == 0)
+                       ;
 
                sb->disks[di->disk.number].state &= ~(1<<MD_DISK_FAULTY);
 
@@ -921,9 +922,7 @@ static struct supertype *match_metadata_desc0(char *arg)
        while (arg[0] == '0' && arg[1] == '0')
                arg++;
        if (strcmp(arg, "0") == 0 ||
-           strcmp(arg, "0.90") == 0 ||
-           strcmp(arg, "default") == 0 ||
-           strcmp(arg, "") == 0 /* no metadata */
+           strcmp(arg, "0.90") == 0
                )
                return st;
 
@@ -972,9 +971,14 @@ static int add_internal_bitmap0(struct supertype *st, int *chunkp,
                min_chunk *= 2;
                bits = (bits+1)/2;
        }
-       if (chunk == UnSet)
+       if (chunk == UnSet) {
+               /* A chunk size less than a few Megabytes gives poor
+                * performance without increasing resync noticeably
+                */
                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 */
 
        sb->state |= (1<<MD_SB_BITMAP_PRESENT);
@@ -1076,12 +1080,22 @@ static int validate_geometry0(struct supertype *st, int level,
        unsigned long long ldsize;
        int fd;
 
-       if (level == LEVEL_CONTAINER)
+       if (level == LEVEL_CONTAINER) {
+               if (verbose)
+                       fprintf(stderr, Name ": 0.90 metadata does not support containers\n");
                return 0;
-       if (raiddisks > MD_SB_DISKS)
+       }
+       if (raiddisks > MD_SB_DISKS) {
+               if (verbose)
+                       fprintf(stderr, Name ": 0.90 metadata supports at most %d devices per array\n",
+                               MD_SB_DISKS);
                return 0;
-       if (size > (0x7fffffffULL<<9))
+       }
+       if (size > (0x7fffffffULL<<9)) {
+               if (verbose)
+                       fprintf(stderr, Name ": 0.90 metadata supports at most 2 terrabytes per device\n");
                return 0;
+       }
        if (!subdev)
                return 1;