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

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