Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame^] | 1 | From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 |
| 2 | From: Benjamin Marzinski <bmarzins@redhat.com> |
| 3 | Date: Wed, 2 Jul 2014 12:49:53 -0500 |
| 4 | Subject: [PATCH] RH: Remove the property blacklist exception builtin |
| 5 | |
| 6 | Multipath set the default property blacklist exceptions to |
| 7 | (ID_SCSI_VPD|ID_WWN). This has the effect of blacklisting some internal |
| 8 | devices. These devices may never have multiple paths, but it is nice |
| 9 | to be able to set multipath up on them all the same. This patch simply |
| 10 | removes the default, and makes it so that if no property |
| 11 | blacklist_exception is given, then devices aren't failed for not matching |
| 12 | it. |
| 13 | |
| 14 | Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com> |
| 15 | --- |
| 16 | libmultipath/blacklist.c | 15 ++++++--------- |
| 17 | multipath/multipath.conf.5 | 14 ++++++++------ |
| 18 | 2 files changed, 14 insertions(+), 15 deletions(-) |
| 19 | |
| 20 | diff --git a/libmultipath/blacklist.c b/libmultipath/blacklist.c |
| 21 | index ee396e2..19d4697 100644 |
| 22 | --- a/libmultipath/blacklist.c |
| 23 | +++ b/libmultipath/blacklist.c |
| 24 | @@ -181,12 +181,6 @@ setup_default_blist (struct config * conf) |
| 25 | if (store_ble(conf->blist_devnode, str, ORIGIN_DEFAULT)) |
| 26 | return 1; |
| 27 | |
| 28 | - str = STRDUP("(SCSI_IDENT_|ID_WWN)"); |
| 29 | - if (!str) |
| 30 | - return 1; |
| 31 | - if (store_ble(conf->elist_property, str, ORIGIN_DEFAULT)) |
| 32 | - return 1; |
| 33 | - |
| 34 | vector_foreach_slot (conf->hwtable, hwe, i) { |
| 35 | if (hwe->bl_product) { |
| 36 | if (_blacklist_device(conf->blist_device, hwe->vendor, |
| 37 | @@ -390,9 +384,12 @@ filter_property(struct config * conf, struct udev_device * udev) |
| 38 | * This is the inverse of the 'normal' matching; |
| 39 | * the environment variable _has_ to match. |
| 40 | */ |
| 41 | - log_filter(devname, NULL, NULL, NULL, NULL, |
| 42 | - MATCH_PROPERTY_BLIST_MISSING); |
| 43 | - return MATCH_PROPERTY_BLIST_MISSING; |
| 44 | + if (VECTOR_SIZE(conf->elist_property)) { |
| 45 | + log_filter(devname, NULL, NULL, NULL, NULL, |
| 46 | + MATCH_PROPERTY_BLIST_MISSING); |
| 47 | + return MATCH_PROPERTY_BLIST_MISSING; |
| 48 | + } |
| 49 | + return 0; |
| 50 | } |
| 51 | |
| 52 | void |
| 53 | diff --git a/multipath/multipath.conf.5 b/multipath/multipath.conf.5 |
| 54 | index 30d8598..c45da9f 100644 |
| 55 | --- a/multipath/multipath.conf.5 |
| 56 | +++ b/multipath/multipath.conf.5 |
| 57 | @@ -1179,10 +1179,6 @@ The \fIWorld Wide Identification\fR of a device. |
| 58 | .TP |
| 59 | .B property |
| 60 | Regular expression of the udev property to be whitelisted. |
| 61 | -.RS |
| 62 | -.TP |
| 63 | -The default is: \fB(SCSI_IDENT_|ID_WWN)\fR |
| 64 | -.RE |
| 65 | .TP |
| 66 | .B device |
| 67 | Subsection for the device description. This subsection recognizes the |
| 68 | @@ -1193,8 +1189,14 @@ keywords. For a full description of these keywords please see the \fIdevices\fR |
| 69 | section description. |
| 70 | .LP |
| 71 | The \fIproperty\fR whitelist handling is different from the usual |
| 72 | -handling in the sense that the device \fIhas\fR to have a udev property that |
| 73 | -matches the whitelist, otherwise the device will be blacklisted. In these cases the message \fIblacklisted, udev property missing\fR will be displayed. |
| 74 | +handling in the sense that if the propery whitelist is set, the device |
| 75 | +\fIhas\fR to have a udev property that matches the whitelist, otherwise the |
| 76 | +device will be blacklisted. In these cases the message \fIblacklisted, udev |
| 77 | +property missing\fR will be displayed. For example settting the |
| 78 | +property blacklist_exception to \fB(SCSI_IDENT_|ID_WWN)\fR will blacklist |
| 79 | +all devices that have no udev property whose name regex matches either |
| 80 | +\fBSCSI_IDENT_\fR or \fBID_WWN\fR. This works to exclude most |
| 81 | +non-multipathable devices. |
| 82 | . |
| 83 | . |
| 84 | .\" ---------------------------------------------------------------------------- |
| 85 | -- |
| 86 | 2.7.4 |
| 87 | |