if (strcmp(update, "assemble")==0) {
int d = info->disk.number;
int wonly = sb->disks[d].state & (1<<MD_DISK_WRITEMOSTLY);
- if ((sb->disks[d].state & ~(1<<MD_DISK_WRITEMOSTLY))
+ int mask = (1<<MD_DISK_WRITEMOSTLY);
+ int add = 0;
+ if (sb->minor_version >= 91)
+ /* During reshape we don't insist on everything
+ * being marked 'sync'
+ */
+ add = (1<<MD_DISK_SYNC);
+ if (((sb->disks[d].state & ~mask) | add)
!= info->disk.state) {
sb->disks[d].state = info->disk.state | wonly;
rv = 1;
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);
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;
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);
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;