From: huang.wei56@zte.com.cn
To: Christophe Varoqui <christophe.varoqui@opensvc.com>
Cc: tang.junhui@zte.com.cn, "wei.huang" <huang.wei56@zte.com.cn>,
zhang.kai16@zte.com.cn, dm-devel@redhat.com
Subject: [PATCH] hwe_regmatch: match error
Date: Fri, 14 Oct 2016 10:03:51 +0800 [thread overview]
Message-ID: <1476410631-7840-1-git-send-email-huang.wei56@zte.com.cn> (raw)
From: "wei.huang" <huang.wei56@zte.com.cn>
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@zte.com.cn>
---
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
next reply other threads:[~2016-10-14 2:03 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-10-14 2:03 huang.wei56 [this message]
2016-10-14 6:00 ` [PATCH] hwe_regmatch: match error Hannes Reinecke
[not found] <OF7CB3362D.2C97E5BB-ON4825805E.00108B17-4825805E.0010903E@LocalDomain>
2016-11-01 3:12 ` tang.junhui
2016-11-01 16:05 ` Benjamin Marzinski
2016-11-03 13:44 ` Christophe Varoqui
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1476410631-7840-1-git-send-email-huang.wei56@zte.com.cn \
--to=huang.wei56@zte.com.cn \
--cc=christophe.varoqui@opensvc.com \
--cc=dm-devel@redhat.com \
--cc=tang.junhui@zte.com.cn \
--cc=zhang.kai16@zte.com.cn \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.