int i;
int map_disks = info->array.raid_disks;
+ memset(info, 0, sizeof(*info));
info->array.major_version = sb->major_version;
info->array.minor_version = sb->minor_version;
info->array.patch_version = sb->patch_version;
sb->disks[d].state = info->disk.state | wonly;
rv = 1;
}
+ if (info->reshape_active &&
+ sb->minor_version > 90 && (sb->reshape_position+1) != 0 &&
+ info->delta_disks >= 0 &&
+ info->reshape_progress < sb->reshape_position) {
+ sb->reshape_position = info->reshape_progress;
+ rv = 1;
+ }
+ if (info->reshape_active &&
+ sb->minor_version > 90 && (sb->reshape_position+1) != 0 &&
+ info->delta_disks < 0 &&
+ info->reshape_progress > sb->reshape_position) {
+ sb->reshape_position = info->reshape_progress;
+ rv = 1;
+ }
} else if (strcmp(update, "linear-grow-new") == 0) {
memset(&sb->disks[info->disk.number], 0, sizeof(sb->disks[0]));
sb->disks[info->disk.number].number = info->disk.number;
sb->state &= ~(1<<MD_SB_CLEAN);
sb->recovery_cp = 0;
} else if (strcmp(update, "homehost") == 0 &&
- homehost) {
+ homehost) {
uuid_set = 0;
update = "uuid";
info->uuid[0] = sb->set_uuid0;
#ifndef MDASSEMBLE
static int validate_geometry0(struct supertype *st, int level,
int layout, int raiddisks,
- int chunk, unsigned long long size,
+ int *chunk, unsigned long long size,
char *subdev, unsigned long long *freesize,
int verbose)
{
fprintf(stderr, Name ": 0.90 metadata supports at most 2 terrabytes per device\n");
return 0;
}
+ if (chunk && *chunk == UnSet)
+ *chunk = DEFAULT_CHUNK;
+
if (!subdev)
return 1;