>From 085fade553c653f89c2b486b7ec552303a5fb9f1 Mon Sep 17 00:00:00 2001 From: Anna Czarnowska <anna.czarnowska@xxxxxxxxx> Date: Thu, 3 Feb 2011 14:30:43 +0100 Subject: [PATCH] fix: array is reassembled inactive if stopped during resync Cc: linux-raid@xxxxxxxxxxxxxxx, Williams, Dan J <dan.j.williams@xxxxxxxxx>, Ciechanowski, Ed <ed.ciechanowski@xxxxxxxxx> 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@xxxxxxxxx> Signed-off-by: Adam Kwolek <adam.kwolek@xxxxxxxxx> --- super-intel.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/super-intel.c b/super-intel.c index d049cb7..59356e0 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 -- 1.7.1 -- To unsubscribe from this list: send the line "unsubscribe linux-raid" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html