Manage: fix test for 'is array failed'.

We 'active_disks' does not count spares, so if array is rebuilding,
this will not necessarily find all devices, so may report an array
as failed when it isn't.

Counting up to nr_disks is better.

Signed-off-by: NeilBrown <neilb@suse.de>
This commit is contained in:
NeilBrown 2015-05-06 15:03:50 +10:00
parent 72a4577704
commit d180d2aa2a
1 changed files with 1 additions and 1 deletions

View File

@ -827,7 +827,7 @@ int Manage_add(int fd, int tfd, struct mddev_dev *dv,
int d;
int found = 0;
for (d = 0; d < MAX_DISKS && found < array->active_disks; d++) {
for (d = 0; d < MAX_DISKS && found < array->nr_disks; d++) {
disc.number = d;
if (ioctl(fd, GET_DISK_INFO, &disc))
continue;