Blame SOURCES/0014-RH-Remove-the-property-blacklist-exception-builtin.patch

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