[PATCH 1/2] Assemble: we need to read policy to know array domains

[PATCH 1/2] Assemble: we need to read policy to know array domains

am 04.01.2011 15:05:09 von anna.czarnowska

From ae360c641fc5c266bb419612e6542b6f9f3e38ca Mon Sep 17 00:00:00 2001
From: Anna Czarnowska
Date: Tue, 4 Jan 2011 11:47:34 +0100
Subject: [PATCH 1/2] Assemble: we need to read policy to know array domains
Cc: linux-raid@vger.kernel.org, Williams, Dan J , Ciechanowski, Ed

Policy must be read on all disks identified as array members
to get array's domains list.
Currently it is only read on first array member in auto assembly mode.

Signed-off-by: Anna Czarnowska
---
Assemble.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/Assemble.c b/Assemble.c
index 5725b23..ed59e8b 100644
--- a/Assemble.c
+++ b/Assemble.c
@@ -547,7 +547,8 @@ int Assemble(struct supertype *st, char *mddev,
loop:
/* Collect domain information from members only */
if (tmpdev && tmpdev->used == 1)
- domain_merge(&domains, pol, tst?tst->ss->name:NULL);
+ domain_merge(&domains, pol?pol:devnum_policy(stb.st_rdev),
+ tst?tst->ss->name:NULL);
dev_policy_free(pol);
pol = NULL;
if (tst)
--
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 1/2] Assemble: we need to read policy to know arraydomains

am 05.01.2011 03:43:39 von NeilBrown

On Tue, 4 Jan 2011 14:05:09 +0000 "Czarnowska, Anna"
wrote:

> >From ae360c641fc5c266bb419612e6542b6f9f3e38ca Mon Sep 17 00:00:00 2001
> From: Anna Czarnowska
> Date: Tue, 4 Jan 2011 11:47:34 +0100
> Subject: [PATCH 1/2] Assemble: we need to read policy to know array domains
> Cc: linux-raid@vger.kernel.org, Williams, Dan J , Ciechanowski, Ed
>
> Policy must be read on all disks identified as array members
> to get array's domains list.
> Currently it is only read on first array member in auto assembly mode.
>
> Signed-off-by: Anna Czarnowska
> ---
> Assemble.c | 3 ++-
> 1 files changed, 2 insertions(+), 1 deletions(-)
>
> diff --git a/Assemble.c b/Assemble.c
> index 5725b23..ed59e8b 100644
> --- a/Assemble.c
> +++ b/Assemble.c
> @@ -547,7 +547,8 @@ int Assemble(struct supertype *st, char *mddev,
> loop:
> /* Collect domain information from members only */
> if (tmpdev && tmpdev->used == 1)
> - domain_merge(&domains, pol, tst?tst->ss->name:NULL);
> + domain_merge(&domains, pol?pol:devnum_policy(stb.st_rdev),
> + tst?tst->ss->name:NULL);
> dev_policy_free(pol);
> pol = NULL;
> if (tst)

Thanks.
I've applied this, though I change it to store the newly read policy into
'pol' so that it would get freed appropriately.

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