From: Czarnowska, Anna Date: Tue, 8 Feb 2011 00:44:42 +0000 (+1100) Subject: fix: array is reassembled inactive if stopped during resync X-Git-Tag: mdadm-3.2.1~130 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=21f3b9cc44091f05d0d55a9c9afb64d73068d04b;p=thirdparty%2Fmdadm.git 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 Signed-off-by: Adam Kwolek Signed-off-by: NeilBrown --- diff --git a/super-intel.c b/super-intel.c index d049cb77..59356e05 100644 --- a/super-intel.c +++ b/super-intel.c @@ -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