From fea207667ab81cfc11f15f906619498f042d5579 Mon Sep 17 00:00:00 2001 From: Packit Service Date: Feb 06 2021 08:12:49 +0000 Subject: Apply patch 0012-RH-Remove-the-property-blacklist-exception-builtin.patch patch_name: 0012-RH-Remove-the-property-blacklist-exception-builtin.patch present_in_specfile: true location_in_specfile: 12 --- diff --git a/libmultipath/blacklist.c b/libmultipath/blacklist.c index 00e8dbd..d9691b1 100644 --- a/libmultipath/blacklist.c +++ b/libmultipath/blacklist.c @@ -204,12 +204,6 @@ setup_default_blist (struct config * conf) if (store_ble(conf->blist_devnode, str, ORIGIN_DEFAULT)) return 1; - str = STRDUP("(SCSI_IDENT_|ID_WWN)"); - if (!str) - return 1; - if (store_ble(conf->elist_property, str, ORIGIN_DEFAULT)) - return 1; - vector_foreach_slot (conf->hwtable, hwe, i) { if (hwe->bl_product) { if (find_blacklist_device(conf->blist_device, @@ -411,7 +405,8 @@ filter_property(struct config *conf, struct udev_device *udev, int lvl, *uid_attribute != '\0'; bool uid_attr_seen = false; - 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 index 05a5e8f..3455b1c 100644 --- a/multipath/multipath.conf.5 +++ b/multipath/multipath.conf.5 @@ -1286,9 +1286,14 @@ keywords. Both are regular expressions. For a full description of these keywords 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. +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. . .RS .PP @@ -1299,10 +1304,6 @@ Blacklisting by missing properties is only applied to devices which do have the 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. -.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. .RE .TP .B protocol diff --git a/tests/blacklist.c b/tests/blacklist.c index 6e7c186..cc8a9a4 100644 --- a/tests/blacklist.c +++ b/tests/blacklist.c @@ -271,7 +271,7 @@ static void test_property_missing(void **state) 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, ""), @@ -363,9 +363,7 @@ static void test_filter_path_missing1(void **state) 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