multipath-tools/0003-RH-Remove-the-property-blacklist-exception-builtin.patch

105 lines
4.4 KiB
Diff
Raw Normal View History

2021-11-23 21:49:34 +08:00
From 7132016384684d7afaa677050454afdc73b18bd9 Mon Sep 17 00:00:00 2001
2020-01-10 17:13:17 +08:00
From: Benjamin Marzinski <bmarzins@redhat.com>
Date: Wed, 2 Jul 2014 12:49:53 -0500
2021-11-23 21:49:34 +08:00
Subject: [PATCH 03/15] RH: Remove the property blacklist exception builtin
2020-01-10 17:13:17 +08:00
Multipath set the default property blacklist exceptions to
(ID_SCSI_VPD|ID_WWN). This has the effect of blacklisting some internal
devices. These devices may never have multiple paths, but it is nice
to be able to set multipath up on them all the same. This patch simply
removes the default, and makes it so that if no property
blacklist_exception is given, then devices aren't failed for not matching
it.
Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
---
2020-11-04 21:19:44 +08:00
libmultipath/blacklist.c | 6 ++----
multipath/multipath.conf.5 | 11 ++++++-----
tests/blacklist.c | 7 ++-----
3 files changed, 10 insertions(+), 14 deletions(-)
2020-01-10 17:13:17 +08:00
diff --git a/libmultipath/blacklist.c b/libmultipath/blacklist.c
2021-11-23 21:49:34 +08:00
index 4e315c9..1e463ef 100644
2020-01-10 17:13:17 +08:00
--- a/libmultipath/blacklist.c
+++ b/libmultipath/blacklist.c
2021-11-23 21:49:34 +08:00
@@ -202,9 +202,6 @@ setup_default_blist (struct config * conf)
2020-11-04 21:19:44 +08:00
if (store_ble(conf->blist_devnode, "!^(sd[a-z]|dasd[a-z]|nvme[0-9])", ORIGIN_DEFAULT))
2020-01-10 17:13:17 +08:00
return 1;
2020-11-04 21:19:44 +08:00
- if (store_ble(conf->elist_property, "(SCSI_IDENT_|ID_WWN)", ORIGIN_DEFAULT))
2020-01-10 17:13:17 +08:00
- return 1;
-
vector_foreach_slot (conf->hwtable, hwe, i) {
if (hwe->bl_product) {
if (find_blacklist_device(conf->blist_device,
2021-11-23 21:49:34 +08:00
@@ -410,7 +407,8 @@ filter_property(const struct config *conf, struct udev_device *udev,
2020-07-16 18:51:36 +08:00
*uid_attribute != '\0';
bool uid_attr_seen = false;
2020-01-10 17:13:17 +08:00
- r = MATCH_PROPERTY_BLIST_MISSING;
+ if (VECTOR_SIZE(conf->elist_property))
+ r = MATCH_PROPERTY_BLIST_MISSING;
udev_list_entry_foreach(list_entry,
udev_device_get_properties_list_entry(udev)) {
diff --git a/multipath/multipath.conf.5 b/multipath/multipath.conf.5
2021-11-23 21:49:34 +08:00
index d6b8c7f..689d09a 100644
2020-01-10 17:13:17 +08:00
--- a/multipath/multipath.conf.5
+++ b/multipath/multipath.conf.5
2021-11-23 21:49:34 +08:00
@@ -1347,9 +1347,14 @@ keywords. Both are regular expressions. For a full description of these keywords
2020-01-10 17:13:17 +08:00
Regular expression for an udev property. All
devices that have matching udev properties will be excluded/included.
The handling of the \fIproperty\fR keyword is special,
-because devices \fBmust\fR have at least one whitelisted udev property;
+because if a property blacklist_exception is set, devices \fBmust\fR have at
+least one whitelisted udev property;
otherwise they're treated as blacklisted, and the message
"\fIblacklisted, udev property missing\fR" is displayed in the logs.
2020-11-04 21:19:44 +08:00
+For example, setting the property blacklist_exception to
+\fB(SCSI_IDENT_|ID_WWN)\fR, will cause well-behaved SCSI devices and devices
+that provide a WWN (World Wide Number) to be included, and all others to be
+excluded. This works to exclude most non-multipathable devices.
2020-07-16 18:51:36 +08:00
.
2020-11-04 21:19:44 +08:00
.RS
.PP
2021-11-23 21:49:34 +08:00
@@ -1360,10 +1365,6 @@ Blacklisting by missing properties is only applied to devices which do have the
2020-07-16 18:51:36 +08:00
property specified by \fIuid_attribute\fR (e.g. \fIID_SERIAL\fR)
set. Previously, it was applied to every device, possibly causing devices to be
blacklisted because of temporary I/O error conditions.
2020-01-10 17:13:17 +08:00
-.PP
-The default \fIblacklist exception\fR is: \fB(SCSI_IDENT_|ID_WWN)\fR, causing
-well-behaved SCSI devices and devices that provide a WWN (World Wide Number)
-to be included, and all others to be excluded.
2020-11-04 21:19:44 +08:00
.RE
2020-01-10 17:13:17 +08:00
.TP
.B protocol
2020-11-04 21:19:44 +08:00
diff --git a/tests/blacklist.c b/tests/blacklist.c
2021-11-23 21:49:34 +08:00
index 882aa3a..6a22b66 100644
2020-11-04 21:19:44 +08:00
--- a/tests/blacklist.c
+++ b/tests/blacklist.c
2021-11-23 21:49:34 +08:00
@@ -375,9 +375,8 @@ static void test_property_missing(void **state)
2020-11-04 21:19:44 +08:00
{
static struct udev_device udev = { "sdb", { "ID_FOO", "ID_BAZ", "ID_BAR", "ID_SERIAL", NULL } };
conf.blist_property = blist_property_wwn;
- expect_condlog(3, "sdb: blacklisted, udev property missing\n");
assert_int_equal(filter_property(&conf, &udev, 3, "ID_SERIAL"),
- MATCH_PROPERTY_BLIST_MISSING);
+ MATCH_NOTHING);
assert_int_equal(filter_property(&conf, &udev, 3, "ID_BLAH"),
MATCH_NOTHING);
assert_int_equal(filter_property(&conf, &udev, 3, ""),
2021-11-23 21:49:34 +08:00
@@ -469,9 +468,7 @@ static void test_filter_path_missing1(void **state)
2020-11-04 21:19:44 +08:00
conf.blist_device = blist_device_foo_bar;
conf.blist_protocol = blist_protocol_fcp;
conf.blist_wwid = blist_wwid_xyzzy;
- expect_condlog(3, "sdb: blacklisted, udev property missing\n");
- assert_int_equal(filter_path(&conf, &miss1_pp),
- MATCH_PROPERTY_BLIST_MISSING);
+ assert_int_equal(filter_path(&conf, &miss1_pp), MATCH_NOTHING);
}
/* This one matches the property whitelist, to test the other missing
2020-01-10 17:13:17 +08:00
--
2020-07-16 18:51:36 +08:00
1.8.3.1
2020-01-10 17:13:17 +08:00