]> git.ipfire.org Git - thirdparty/mdadm.git/commitdiff
imsm: FIX: spares are not counted
authorAdam Kwolek <adam.kwolek@intel.com>
Wed, 12 Jan 2011 23:16:07 +0000 (10:16 +1100)
committerNeilBrown <neilb@suse.de>
Wed, 12 Jan 2011 23:16:07 +0000 (10:16 +1100)
Field info->array.spare_disks is used on begin of reshape_array() to
check if there is enough number of spares to process reshape.  During
container_content_imsm() call spare disks are not counted.  This
causes that reshape_array() reports that there is not enough spares to
execute reshape.

Patch adds spares counting for reshape process.

Signed-off-by: Adam Kwolek <adam.kwolek@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
super-intel.c

index d091d17e2f56885e75308aff2c81993024f1f965..34e03c385768141b294a7ae9e6d77d07f49f1106 100644 (file)
@@ -4632,9 +4632,13 @@ static struct mdinfo *container_content_imsm(struct supertype *st, char *subarra
                        if (map2) {
                                if (slot < map2->num_members)
                                        info_d->disk.state = (1 << MD_DISK_ACTIVE);
+                               else
+                                       this->array.spare_disks++;
                        } else {
                                if (slot < map->num_members)
                                        info_d->disk.state = (1 << MD_DISK_ACTIVE);
+                               else
+                                       this->array.spare_disks++;
                        }
                        if (info_d->recovery_start == MaxSector)
                                this->array.working_disks++;