}
-static int get_resync_start(struct active_array *a)
+int get_resync_start(struct active_array *a)
{
char buf[30];
int n;
}
}
- if (a->curr_action == idle &&
+ if (!deactivate &&
+ a->curr_action == idle &&
a->prev_action == resync) {
/* A resync has finished. The endpoint is recorded in
* 'sync_start'. We don't update the metadata
check_degraded = 1;
}
- if (a->curr_action == idle &&
+ if (!deactivate &&
+ a->curr_action == idle &&
a->prev_action == recover) {
+ /* A recovery has finished. Some disks may be in sync now,
+ * and the array may no longer be degraded
+ */
for (mdi = a->info.devs ; mdi ; mdi = mdi->next) {
a->container->ss->set_disk(a, mdi->disk.raid_disk,
mdi->curr_state);
if (! (mdi->curr_state & DS_INSYNC))
check_degraded = 1;
}
+ a->container->ss->set_array_state(a, 0);
}
for (mdi = a->info.devs ; mdi ; mdi = mdi->next) {