All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] policy.c: Avoid to take spare without defined domain by imsm
@ 2018-01-11 11:39 Mariusz Tkaczyk
  2018-01-21 21:19 ` Jes Sorensen
  0 siblings, 1 reply; 2+ messages in thread
From: Mariusz Tkaczyk @ 2018-01-11 11:39 UTC (permalink / raw)
  To: jes.sorensen; +Cc: linux-raid, Mariusz Tkaczyk

Only Imsm get_disk_controller_domain returns disk controller domain for
each disk. It causes that mdadm automatically creates disk controller
domain policy for imsm metadata, and imsm containers in the same disk
controller domain can take spare for recovery.

Ignore spares if only one imsm domain is matched.

Signed-off-by: Mariusz Tkaczyk <mariusz.tkaczyk@intel.com>
---
 policy.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/policy.c b/policy.c
index b17585a..4f1ca8b 100644
--- a/policy.c
+++ b/policy.c
@@ -661,6 +661,7 @@ int domain_test(struct domainlist *dom, struct dev_policy *pol,
 	 *  1:  has domains, all match
 	 */
 	int found_any = -1;
+	int has_one_domain = 1;
 	struct dev_policy *p;
 
 	pol = pol_find(pol, pol_domain);
@@ -670,6 +671,9 @@ int domain_test(struct domainlist *dom, struct dev_policy *pol,
 			dom = dom->next;
 		if (!dom || strcmp(dom->dom, p->value) != 0)
 			return 0;
+		if (has_one_domain && metadata && strcmp(metadata, "imsm") == 0)
+			found_any = -1;
+		has_one_domain = 0;
 	}
 	return found_any;
 }
-- 
1.8.3.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] policy.c: Avoid to take spare without defined domain by imsm
  2018-01-11 11:39 [PATCH] policy.c: Avoid to take spare without defined domain by imsm Mariusz Tkaczyk
@ 2018-01-21 21:19 ` Jes Sorensen
  0 siblings, 0 replies; 2+ messages in thread
From: Jes Sorensen @ 2018-01-21 21:19 UTC (permalink / raw)
  To: Mariusz Tkaczyk; +Cc: linux-raid

On 01/11/2018 06:39 AM, Mariusz Tkaczyk wrote:
> Only Imsm get_disk_controller_domain returns disk controller domain for
> each disk. It causes that mdadm automatically creates disk controller
> domain policy for imsm metadata, and imsm containers in the same disk
> controller domain can take spare for recovery.
> 
> Ignore spares if only one imsm domain is matched.
> 
> Signed-off-by: Mariusz Tkaczyk <mariusz.tkaczyk@intel.com>
> ---
>  policy.c | 4 ++++
>  1 file changed, 4 insertions(+)

Applied!

Thanks,
Jes



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-01-21 21:19 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-01-11 11:39 [PATCH] policy.c: Avoid to take spare without defined domain by imsm Mariusz Tkaczyk
2018-01-21 21:19 ` Jes Sorensen

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.