fix: array is reassembled inactive if stopped during resync

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>
This commit is contained in:
Czarnowska, Anna 2011-02-08 11:44:42 +11:00 committed by NeilBrown
parent 9d0e78406a
commit 21f3b9cc44
1 changed files with 2 additions and 1 deletions

View 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