]> git.ipfire.org Git - thirdparty/mdadm.git/blobdiff - policy.c
Allow domain_test to report that no domains were found.
[thirdparty/mdadm.git] / policy.c
index 38b0072b5d111ab6f76168185c575efc0a5d4d8c..afb640f594a48c74896b25de9cc59cf756a83b72 100644 (file)
--- a/policy.c
+++ b/policy.c
@@ -648,9 +648,12 @@ int domain_test(struct domainlist *dom, struct dev_policy *pol,
        /* Check that all domains in pol (for metadata) are also in
         * dom.  Both lists are sorted.
         * If pol has no domains, we don't really know about this device
-        * so we reject the match.
+        * so we allow caller to choose:
+        * -1:  has no domains
+        *  0:  has domains, not all match
+        *  1:  has domains, all match
         */
-       int found_any = 0;
+       int found_any = -1;
        struct dev_policy *p;
 
        pol = pol_find(pol, pol_domain);