From: Hannes Reinecke <hare@suse.de>
To: Christophe Varoqui <christophe.varoqui@gmail.com>
Cc: dm-devel@redhat.com, Xose Vazquez Perez <xose.vazquez@gmail.com>,
Hannes Reinecke <hare@suse.com>
Subject: [PATCH 3/3] multipath: fixup check for out-of-scope maps
Date: Tue, 9 Aug 2016 09:31:13 +0200 [thread overview]
Message-ID: <1470727873-10502-4-git-send-email-hare@suse.de> (raw)
In-Reply-To: <1470727873-10502-1-git-send-email-hare@suse.de>
The 'wwid' in struct multipath is a static array, so a check for
the existence of 'wwid' is pointless. We should rather check if
the argument 'refwwid' is not NULL and has a length larger then '0'.
Signed-off-by: Hannes Reinecke <hare@suse.com>
---
multipath/main.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/multipath/main.c b/multipath/main.c
index 93376a9..ee00fdbd 100644
--- a/multipath/main.c
+++ b/multipath/main.c
@@ -212,7 +212,7 @@ get_dm_mpvec (enum mpath_cmds cmd, vector curmp, vector pathvec, char * refwwid)
/*
* discard out of scope maps
*/
- if (mpp->wwid && refwwid &&
+ if (refwwid && strlen(refwwid) &&
strncmp(mpp->wwid, refwwid, WWID_SIZE)) {
condlog(3, "skip map %s: out of scope", mpp->alias);
free_multipath(mpp, KEEP_PATHS);
--
2.6.6
next prev parent reply other threads:[~2016-08-09 7:31 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-08-09 7:31 [PATCH 0/3] Clang fixes Hannes Reinecke
2016-08-09 7:31 ` [PATCH 1/3] libmultipath/discovery.c: use 'unsigned long' instead of 'unsigned int' Hannes Reinecke
2016-08-09 7:31 ` [PATCH 2/3] libmultipath/parser.c: correctly terminate buffer Hannes Reinecke
2016-08-09 7:31 ` Hannes Reinecke [this message]
2016-08-09 15:13 ` [PATCH 0/3] Clang fixes 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=1470727873-10502-4-git-send-email-hare@suse.de \
--to=hare@suse.de \
--cc=christophe.varoqui@gmail.com \
--cc=dm-devel@redhat.com \
--cc=hare@suse.com \
--cc=xose.vazquez@gmail.com \
/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.