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

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