[PATCH] fix: array is reassembled inactive if stopped during resync

[PATCH] fix: array is reassembled inactive if stopped during resync

am 03.02.2011 14:40:56 von anna.czarnowska

From 085fade553c653f89c2b486b7ec552303a5fb9f1 Mon Sep 17 00:00:00 2001
From: Anna Czarnowska
Date: Thu, 3 Feb 2011 14:30:43 +0100
Subject: [PATCH] fix: array is reassembled inactive if stopped during resync
Cc: linux-raid@vger.kernel.org, Williams, Dan J , Ciechanowski, Ed

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
---
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@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html

Re: [PATCH] fix: array is reassembled inactive if stopped duringresync

am 08.02.2011 01:46:38 von NeilBrown

On Thu, 3 Feb 2011 13:40:56 +0000 "Czarnowska, Anna"
wrote:

> >From 085fade553c653f89c2b486b7ec552303a5fb9f1 Mon Sep 17 00:00:00 2001
> From: Anna Czarnowska
> Date: Thu, 3 Feb 2011 14:30:43 +0100
> Subject: [PATCH] fix: array is reassembled inactive if stopped during resync
> Cc: linux-raid@vger.kernel.org, Williams, Dan J , Ciechanowski, Ed
>
> 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
> ---
> 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


Applied, thanks.

NeilBrown
--
To unsubscribe from this list: send the line "unsubscribe linux-raid" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html