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

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