mddev_dev_t tmpdev;
struct mdinfo info;
struct mdinfo *content = NULL;
- mdu_array_info_t tmp_inf;
char *avail;
int nextspare = 0;
char *name = NULL;
close(mdfd);
return 1;
}
- if (ioctl(mdfd, GET_ARRAY_INFO, &tmp_inf)==0) {
+ if (mddev_busy(fd2devnum(mdfd))) {
fprintf(stderr, Name ": %s already active, cannot restart it!\n",
mddev);
for (tmpdev = devlist ;
int j = best[i];
if (j>=0 &&
!devices[j].uptodate &&
- devices[j].i.events > 0 &&
(chosen_drive < 0 ||
devices[j].i.events
> devices[chosen_drive].i.events))
int j = best[i];
if (j >= 0 &&
!devices[j].uptodate &&
- devices[j].i.events > 0 &&
devices[j].i.events == current_events) {
chosen_drive = j;
goto add_another;
continue;
devices[j].i.disk.state = desired_state;
+ if (!(devices[j].i.array.state & 1))
+ clean = 0;
if (st->ss->update_super(st, &devices[j].i, "assemble", NULL,
verbose, 0, NULL)) {
fprintf(stderr, "\n");
}
sysfs_uevent(content, "change");
+ wait_for(chosen_name);
close(mdfd);
return 0;
}
fprintf(stderr, " and %d spare%s", sparecnt, sparecnt==1?"":"s");
fprintf(stderr, ".\n");
}
+ if (content->reshape_active &&
+ content->array.level >= 4 &&
+ content->array.level <= 6) {
+ /* might need to increase the size
+ * of the stripe cache - default is 256
+ */
+ if (256 < 4 * (content->array.chunk_size/4096)) {
+ struct mdinfo *sra = sysfs_read(mdfd, 0, 0);
+ if (sra)
+ sysfs_set_num(sra, NULL,
+ "stripe_cache_size",
+ (4 * content->array.chunk_size / 4096) + 1);
+ }
+ }
close(mdfd);
wait_for(mddev);
if (auto_assem) {