[dm-devel] [PATCH 4/5] mpath: skip device configs without vendor/product
Benjamin Marzinski
bmarzins at redhat.com
Fri Jun 2 03:09:11 UTC 2017
Right now if multipath.conf includes a device configuration without a
vendor or product string, it will automatically be applied to all
devices, skipping all other configs entirely. This is clearly wrong.
This patch makes sure that user added configs include vendor and
product strings
Signed-off-by: Benjamin Marzinski <bmarzins at redhat.com>
---
libmultipath/config.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/libmultipath/config.c b/libmultipath/config.c
index bb6619b..6b23601 100644
--- a/libmultipath/config.c
+++ b/libmultipath/config.c
@@ -451,6 +451,13 @@ restart:
break;
j = n;
vector_foreach_slot_after(hw, hwe2, j) {
+ /* drop invalid device configs */
+ if (!hwe2->vendor || !hwe2->product) {
+ condlog(0, "device config missing vendor or product parameter");
+ vector_del_slot(hw, j--);
+ free_hwe(hwe2);
+ continue;
+ }
if (hwe_regmatch(hwe1, hwe2))
continue;
/* dup */
--
2.7.4
More information about the dm-devel
mailing list