Skip to content
This repository has been archived by the owner on Oct 12, 2020. It is now read-only.

Commit

Permalink
Manage: fix test for 'is array failed'.
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
neilbrown committed May 6, 2015
1 parent 72a4577 commit d180d2a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Manage.c
Expand Up @@ -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;
Expand Down

0 comments on commit d180d2a

Please sign in to comment.