if (mdstat->level) {
int level = map_name(pers, mdstat->level);
if (level == 0 || level == LEVEL_LINEAR) {
- a->container = NULL;
+ a->to_remove = 1;
wakeup_monitor();
return;
}
/* Looks like a member of this container */
for (a = container->arrays; a; a = a->next) {
if (mdstat->devnum == a->devnum) {
- if (a->container)
+ if (a->container && a->to_remove == 0)
manage_member(mdstat, a);
break;
}
struct mdinfo *victim;
for (a = aa; a; a = a->next) {
- if (!a->container)
+ if (!a->container || a->to_remove)
continue;
victim = find_device(a, failed->disk.major, failed->disk.minor);
if (!victim)
/* once an array has been deactivated we want to
* ask the manager to discard it.
*/
- if (!a->container) {
+ if (!a->container || a->to_remove) {
if (discard_this) {
ap = &(*ap)->next;
continue;
/* FIXME check if device->state_fd need to be cleared?*/
signal_manager();
}
- if (a->container) {
+ if (a->container && !a->to_remove) {
is_dirty = read_and_act(a);
rv |= 1;
dirty_arrays += is_dirty;
/* propagate failures across container members */
for (a = *aap; a ; a = a->next) {
- if (!a->container)
+ if (!a->container || a->to_remove)
continue;
for (mdi = a->info.devs ; mdi ; mdi = mdi->next)
if (mdi->curr_state & DS_FAULTY)