From: NeilBrown Date: Wed, 6 May 2015 05:03:50 +0000 (+1000) Subject: Manage: fix test for 'is array failed'. X-Git-Tag: mdadm-3.3.3~64 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d180d2aa2a17;p=thirdparty%2Fmdadm.git 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 --- diff --git a/Manage.c b/Manage.c index d3cfb551..225af813 100644 --- a/Manage.c +++ b/Manage.c @@ -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;