mdp_super_t *sb = st->sb;
time_t atime;
int d;
+ int delta_extra = 0;
char *c;
printf(" Magic : %08x\n", sb->md_magic);
printf(" Reshape pos'n : %llu%s\n", (unsigned long long)sb->reshape_position/2, human_size((long long)sb->reshape_position<<9));
if (sb->delta_disks) {
printf(" Delta Devices : %d", sb->delta_disks);
- if (sb->delta_disks)
- printf(" (%d->%d)\n", sb->raid_disks-sb->delta_disks, sb->raid_disks);
- else
- printf(" (%d->%d)\n", sb->raid_disks, sb->raid_disks+sb->delta_disks);
+ printf(" (%d->%d)\n", sb->raid_disks-sb->delta_disks, sb->raid_disks);
+ if (((int)sb->delta_disks) < 0)
+ delta_extra = - sb->delta_disks;
}
if (sb->new_level != sb->level) {
c = map_num(pers, sb->new_level);
c = map_num(r5layout, sb->new_layout);
printf(" New Layout : %s\n", c?c:"-unknown-");
}
+ if (sb->level == 6) {
+ c = map_num(r6layout, sb->new_layout);
+ printf(" New Layout : %s\n", c?c:"-unknown-");
+ }
if (sb->level == 10) {
printf(" New Layout : near=%d, %s=%d\n",
sb->new_layout&255,
c = map_num(r5layout, sb->layout);
printf(" Layout : %s\n", c?c:"-unknown-");
}
+ if (sb->level == 6) {
+ c = map_num(r6layout, sb->layout);
+ printf(" Layout : %s\n", c?c:"-unknown-");
+ }
if (sb->level == 10) {
printf(" Layout :");
print_r10_layout(sb->layout);
}
printf("\n");
printf(" Number Major Minor RaidDevice State\n");
- for (d= -1; d<(signed int)(sb->raid_disks+sb->spare_disks); d++) {
+ for (d= -1; d<(signed int)(sb->raid_disks+delta_extra + sb->spare_disks); d++) {
mdp_disk_t *dp;
char *dv;
char nb[5];
info->delta_disks = sb->delta_disks;
info->new_layout = sb->new_layout;
info->new_chunk = sb->new_chunk;
+ if (info->delta_disks < 0)
+ info->array.raid_disks -= info->delta_disks;
} else
info->reshape_active = 0;
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;