From d180d2aa2a1770af1ab8520d6362ba331400512f Mon Sep 17 00:00:00 2001 From: NeilBrown Date: Wed, 6 May 2015 15:03:50 +1000 Subject: [PATCH] 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 --- Manage.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Manage.c b/Manage.c index d3cfb55..225af81 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;