These need to be counted in the number of 'active' devices.
Signed-off-by: NeilBrown <neilb@suse.de>
/* count how many devices in sra think they are active */
struct mdinfo *d;
int cnt = 0;
+ int replcnt = 0;
__u64 max_events = 0;
char *avail = NULL;
int *best = NULL;
best[info.disk.raid_disk] = devnum;
st->ss->getinfo_super(st, bestinfo, NULL);
}
- }
+ } else if (info.disk.state & (1<<MD_DISK_REPLACEMENT))
+ replcnt++;
st->ss->free_super(st);
}
if (!avail)
}
free(best);
free(devmap);
- return cnt;
+ return cnt + replcnt;
}
/* test if container has degraded member(s) */
info->name[32] = 0;
if ((__le32_to_cpu(sb->feature_map)&MD_FEATURE_REPLACEMENT)) {
+ info->disk.state &= ~(1 << MD_DISK_SYNC);
info->disk.state |= 1 << MD_DISK_REPLACEMENT;
}