]> git.ipfire.org Git - thirdparty/mdadm.git/commitdiff
fix: array is reassembled inactive if stopped during resync
authorCzarnowska, Anna <anna.czarnowska@intel.com>
Tue, 8 Feb 2011 00:44:42 +0000 (11:44 +1100)
committerNeilBrown <neilb@suse.de>
Tue, 8 Feb 2011 00:44:42 +0000 (11:44 +1100)
If initial resync or recovery of a redundant array is not finished
before it is stopped then during assembly md will start it as inactive.
Writing readonly to array_state in assemble_container_content
fails because md thinks the array is during reshape.

In fact we only have a reshape if both current and previous map
states are the same. Otherwise we may have resync or recovery.
Setting reshape_active in such cases causes the issue.

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

index d049cb7728693ef0372c36acba418527a555df9b..59356e05e9b87137da19d63adfed3fb51c5beb34 100644 (file)
@@ -1772,7 +1772,8 @@ static void getinfo_super_imsm_volume(struct supertype *st, struct mdinfo *info,
                __le32_to_cpu(map_to_analyse->blocks_per_member);
        memset(info->uuid, 0, sizeof(info->uuid));
        info->recovery_start = MaxSector;
-       info->reshape_active = (prev_map != NULL);
+       info->reshape_active = (prev_map != NULL) &&
+                              (map->map_state == prev_map->map_state);
        if (info->reshape_active)
                info->delta_disks = map->num_members - prev_map->num_members;
        else