]> git.ipfire.org Git - thirdparty/mdadm.git/commitdiff
Manage: fix test for 'is array failed'.
authorNeilBrown <neilb@suse.de>
Wed, 6 May 2015 05:03:50 +0000 (15:03 +1000)
committerNeilBrown <neilb@suse.de>
Wed, 6 May 2015 05:03:50 +0000 (15:03 +1000)
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>
Manage.c

index d3cfb551e623b5e84f866d5d7cd67e539a249d1c..225af81384cba26d82ba3bad3da6639ecbe8e07f 100644 (file)
--- 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;