* [PATCH] Monitor: Check destination array domain early.
@ 2010-12-17 13:26 Labun, Marcin
2010-12-20 22:07 ` Neil Brown
0 siblings, 1 reply; 2+ messages in thread
From: Labun, Marcin @ 2010-12-17 13:26 UTC (permalink / raw)
To: neilb@suse.de
Cc: linux-raid@vger.kernel.org, Neubauer, Wojciech,
Hawrylewicz Czarnowski, Przemyslaw, Czarnowska, Anna,
Williams, Dan J
From 868faba9b94b8278c93f9f8026b05fb698212207 Mon Sep 17 00:00:00 2001
From: Marcin Labun <marcin.labun@intel.com>
Date: Thu, 16 Dec 2010 15:16:12 +0100
Subject: [PATCH] Monitor: Check destination array domain early.
Destination arrays that do not have any domains are excluded
from spare sharing. We can check it early, without searching
for donor arrays.
Signed-off-by: Marcin Labun <marcin.labun@intel.com>
---
Monitor.c | 14 ++++++++------
1 files changed, 8 insertions(+), 6 deletions(-)
diff --git a/Monitor.c b/Monitor.c
index ce160f3..e79f658 100644
--- a/Monitor.c
+++ b/Monitor.c
@@ -767,8 +767,7 @@ static int move_spare(struct state *from, struct state *to,
return 0;
}
-static int check_donor(struct state *from, struct state *to,
- struct domainlist *domlist)
+static int check_donor(struct state *from, struct state *to)
{
struct state *sub;
@@ -790,8 +789,6 @@ static int check_donor(struct state *from, struct state *to,
return 0;
if (from->spare <= 0)
return 0;
- if (domlist == NULL)
- return 0;
return 1;
}
@@ -923,10 +920,15 @@ static void try_spare_migration(struct state *statelist, struct alert_info *info
to->metadata->ss->name);
if (to->spare_group)
domain_add(&domlist, to->spare_group);
-
+ /*
+ * No spare migration if the destination
+ * has no domain. Skip this array.
+ */
+ if (!domlist)
+ continue;
for (from=statelist ; from ; from=from->next) {
dev_t devid;
- if (!check_donor(from, to, domlist))
+ if (!check_donor(from, to))
continue;
if (from->metadata->ss->external)
devid = container_choose_spare(
--
1.6.4.2
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: [PATCH] Monitor: Check destination array domain early.
2010-12-17 13:26 [PATCH] Monitor: Check destination array domain early Labun, Marcin
@ 2010-12-20 22:07 ` Neil Brown
0 siblings, 0 replies; 2+ messages in thread
From: Neil Brown @ 2010-12-20 22:07 UTC (permalink / raw)
To: Labun, Marcin
Cc: linux-raid@vger.kernel.org, Neubauer, Wojciech,
Hawrylewicz Czarnowski, Przemyslaw, Czarnowska, Anna,
Williams, Dan J
On Fri, 17 Dec 2010 13:26:42 +0000 "Labun, Marcin" <Marcin.Labun@intel.com>
wrote:
> >From 868faba9b94b8278c93f9f8026b05fb698212207 Mon Sep 17 00:00:00 2001
> From: Marcin Labun <marcin.labun@intel.com>
> Date: Thu, 16 Dec 2010 15:16:12 +0100
> Subject: [PATCH] Monitor: Check destination array domain early.
>
> Destination arrays that do not have any domains are excluded
> from spare sharing. We can check it early, without searching
> for donor arrays.
Applied. Thanks.
NeilBrown
>
> Signed-off-by: Marcin Labun <marcin.labun@intel.com>
> ---
> Monitor.c | 14 ++++++++------
> 1 files changed, 8 insertions(+), 6 deletions(-)
>
> diff --git a/Monitor.c b/Monitor.c
> index ce160f3..e79f658 100644
> --- a/Monitor.c
> +++ b/Monitor.c
> @@ -767,8 +767,7 @@ static int move_spare(struct state *from, struct state *to,
> return 0;
> }
>
> -static int check_donor(struct state *from, struct state *to,
> - struct domainlist *domlist)
> +static int check_donor(struct state *from, struct state *to)
> {
> struct state *sub;
>
> @@ -790,8 +789,6 @@ static int check_donor(struct state *from, struct state *to,
> return 0;
> if (from->spare <= 0)
> return 0;
> - if (domlist == NULL)
> - return 0;
> return 1;
> }
>
> @@ -923,10 +920,15 @@ static void try_spare_migration(struct state *statelist, struct alert_info *info
> to->metadata->ss->name);
> if (to->spare_group)
> domain_add(&domlist, to->spare_group);
> -
> + /*
> + * No spare migration if the destination
> + * has no domain. Skip this array.
> + */
> + if (!domlist)
> + continue;
> for (from=statelist ; from ; from=from->next) {
> dev_t devid;
> - if (!check_donor(from, to, domlist))
> + if (!check_donor(from, to))
> continue;
> if (from->metadata->ss->external)
> devid = container_choose_spare(
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2010-12-20 22:07 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-12-17 13:26 [PATCH] Monitor: Check destination array domain early Labun, Marcin
2010-12-20 22:07 ` Neil Brown
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).