[PATCH] hwe_regmatch: match error

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: "wei.huang" <huang.wei56@xxxxxxxxxx>

Problem:
when we configure a device like vendor, product, revision all null in multipath.conf, hwe_regmatch always return 0.

Reasons:
\!hwe2->vendor, \!hwe2->product and \!hwe2->revision are all true.

Signed-off-by: wei.huang <huang.wei56@xxxxxxxxxx>
---
 libmultipath/config.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/libmultipath/config.c b/libmultipath/config.c
index a48b8af..d99cd75 100644
--- a/libmultipath/config.c
+++ b/libmultipath/config.c
@@ -80,7 +80,8 @@ hwe_regmatch (struct hwentry *hwe1, struct hwentry *hwe2)
 	    regcomp(&rre, hwe1->revision, REG_EXTENDED|REG_NOSUB))
 		goto out_pre;
 
-	if ((!hwe1->vendor || !hwe2->vendor ||
+	if ((hwe2->vendor || hwe2->product || hwe2->revision) &&
+	    (!hwe1->vendor || !hwe2->vendor ||
 	     !regexec(&vre, hwe2->vendor, 0, NULL, 0)) &&
 	    (!hwe1->product || !hwe2->product ||
 	     !regexec(&pre, hwe2->product, 0, NULL, 0)) &&
-- 
2.8.1.windows.1

--
dm-devel mailing list
dm-devel@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/dm-devel



[Index of Archives]     [DM Crypt]     [Fedora Desktop]     [ATA RAID]     [Fedora Marketing]     [Fedora Packaging]     [Fedora SELinux]     [Yosemite Discussion]     [KDE Users]     [Fedora Docs]

  Powered by Linux