]> git.ipfire.org Git - thirdparty/mdadm.git/commitdiff
imsm: Fill delta_disks field in getinfo_super()
authorAdam Kwolek <adam.kwolek@intel.com>
Thu, 16 Dec 2010 04:55:40 +0000 (15:55 +1100)
committerNeilBrown <neilb@suse.de>
Thu, 16 Dec 2010 04:55:40 +0000 (15:55 +1100)
delta_disks field is not always filled during getinfo_super() call.

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

index 4e5bbc39023a24befb93b492625ecddd0b40f1db..3fc1c823b2ff447b24dc4734416823de338c9e26 100644 (file)
@@ -1530,6 +1530,7 @@ static void getinfo_super_imsm_volume(struct supertype *st, struct mdinfo *info,
        struct intel_super *super = st->sb;
        struct imsm_dev *dev = get_imsm_dev(super, super->current_vol);
        struct imsm_map *map = get_imsm_map(dev, 0);
+       struct imsm_map *prev_map = get_imsm_map(dev, 1);
        struct dl *dl;
        char *devname;
        int map_disks = info->array.raid_disks;
@@ -1561,7 +1562,11 @@ static void getinfo_super_imsm_volume(struct supertype *st, struct mdinfo *info,
        info->component_size      = __le32_to_cpu(map->blocks_per_member);
        memset(info->uuid, 0, sizeof(info->uuid));
        info->recovery_start = MaxSector;
-       info->reshape_active = 0;
+       info->reshape_active = (prev_map != NULL);
+       if (info->reshape_active)
+               info->delta_disks = map->num_members - prev_map->num_members;
+       else
+               info->delta_disks = 0;
 
        if (map->map_state == IMSM_T_STATE_UNINITIALIZED || dev->vol.dirty) {
                info->resync_start = 0;
@@ -1618,7 +1623,7 @@ static void getinfo_super_imsm_volume(struct supertype *st, struct mdinfo *info,
                        }
                }
        }
-}                              
+}
 
 /* check the config file to see if we can return a real uuid for this spare */
 static void fixup_container_spare_uuid(struct mdinfo *inf)