From: Mauricio Faria de Oliveira <mauricfo@linux.vnet.ibm.com>
To: dm-devel@redhat.com, bmarzins@redhat.com, christophe.varoqui@opensvc.com
Subject: [PATCH v2 2/2] multipathd: skip spurious event message for blacklisted paths
Date: Tue, 13 Dec 2016 16:27:09 -0200 [thread overview]
Message-ID: <1481653629-22430-2-git-send-email-mauricfo@linux.vnet.ibm.com> (raw)
In-Reply-To: <1481653629-22430-1-git-send-email-mauricfo@linux.vnet.ibm.com>
Currently, multipath still prints the 'spurious uevent, path not found'
message if a path is blacklisted by something different than a devnode
in the 'change' uevent handling. (uev_trigger() calls filter_devnode()).
Thus blacklisting by vendor/product, wwid, and udev property still get
that message in the system log for paths that are explicitly marked to
be ignored (since it's verbosity level 0).
This problem happens on common scenarios such as creating filesystems
on a blacklisted device (e.g., mkfs.* /dev/sdX), which is usually run
several times on test environments, and the error message may mislead
the error checker/monitor tools with false negatives.
This patch resolves this by checking the udev property and path_info()
for PATHINFO_SKIPPED with just enough device information flags for
blacklist verification -- and it prints a debug message (verbosity
level 3) instead of an error message since this case is not an error.
Even though this introduces a bit of overhead (to get the path info),
it only happens in a corner case of an error path; so, not a problem.
Test-cases (on QEMU):
----------
Several versions of /etc/multipath.conf:
blacklist {
devnode "sdb"
}
blacklist {
property "ID_SERIAL"
}
blacklist {
wwid "0QEMU_QEMU_HARDDISK_drive-scsi0-0-0-1"
}
blacklist {
device {
vendor "QEMU"
}
}
Either command can be used to generate a 'change' uevent:
# echo change > /sys/block/sdb/uevent
# mkfs.ext3 -F /dev/sdb
The output of multipathd is monitored with:
# multipathd -d -s
...
Without the patch, only the devnode blacklisting is silent;
all other cases (property, wwid, device) print the message:
sdb: spurious uevent, path not found
With the patch applied, no message is printed by default
(that is, verbosity level 2) in any case.
With verbosity level 3 (debug), the following messages
are printed, according to the performed test-case:
sdb: udev property ID_SERIAL blacklisted
sdb: spurious uevent, path is blacklisted
sdb: wwid 0QEMU_QEMU_HARDDISK_drive-scsi0-0-0-1 blacklisted
sdb: spurious uevent, path is blacklisted
(null): (QEMU:QEMU HARDDISK) vendor/product blacklisted
sdb: spurious uevent, path is blacklisted
Reported-by: Yueh Chyong (Ida) Jackson <idaj@us.ibm.com>
Signed-off-by: Mauricio Faria de Oliveira <mauricfo@linux.vnet.ibm.com>
---
multipathd/main.c | 32 +++++++++++++++++++++++++++++++-
1 file changed, 31 insertions(+), 1 deletion(-)
diff --git a/multipathd/main.c b/multipathd/main.c
index d6f081f2f83a..dd7e8d69491e 100644
--- a/multipathd/main.c
+++ b/multipathd/main.c
@@ -1010,8 +1010,38 @@ uev_update_path (struct uevent *uev, struct vectors * vecs)
}
out:
lock_cleanup_pop(vecs->lock);
- if (!pp)
+ if (!pp) {
+ /*
+ * If the path is blacklisted, print a debug/non-default verbosity message.
+ * - filter_devnode() - checked by uev_trigger() (caller);
+ * - filter_device() - checked by pathinfo() (DI_BLACKLIST | DI_SYSFS);
+ * - filter_wwid() - checked by pathinfo() (DI_BLACKLIST | DI_WWID);
+ * - filter_property() - checked here).
+ */
+ if (uev->udev) {
+ int flag = DI_SYSFS | DI_WWID;
+ struct udev_device *udevice;
+
+ udevice = udev_device_ref(uev->udev);
+
+ if (filter_property(conf, udevice) > 0)
+ retval = PATHINFO_SKIPPED;
+ else {
+ conf = get_multipath_config();
+ retval = alloc_path_with_pathinfo(conf, udevice, flag, NULL);
+ put_multipath_config(conf);
+ }
+
+ udev_device_unref(uev->udev);
+
+ if (retval == PATHINFO_SKIPPED) {
+ condlog(3, "%s: spurious uevent, path is blacklisted", uev->kernel);
+ return 0;
+ }
+ }
+
condlog(0, "%s: spurious uevent, path not found", uev->kernel);
+ }
return retval;
}
--
1.8.3.1
next prev parent reply other threads:[~2016-12-13 18:27 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-12-13 18:27 [PATCH v2 1/2] libmultipath: prevent memory leak in alloc_path_with_pathinfo() if pp_ptr is NULL Mauricio Faria de Oliveira
2016-12-13 18:27 ` Mauricio Faria de Oliveira [this message]
2016-12-13 21:50 ` [PATCH v2 2/2] multipathd: skip spurious event message for blacklisted paths Benjamin Marzinski
2016-12-13 23:53 ` Mauricio Faria de Oliveira
2016-12-14 12:53 ` Martin Wilck
2016-12-20 17:00 ` Benjamin Marzinski
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=1481653629-22430-2-git-send-email-mauricfo@linux.vnet.ibm.com \
--to=mauricfo@linux.vnet.ibm.com \
--cc=bmarzins@redhat.com \
--cc=christophe.varoqui@opensvc.com \
--cc=dm-devel@redhat.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox