[PATCH 4/5] mpath: skip device configs without vendor/product

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxx>
---
 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

--
dm-devel mailing list
dm-devel@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/dm-devel



[Index of Archives]     [DM Crypt]     [Fedora Desktop]     [ATA RAID]     [Fedora Marketing]     [Fedora Packaging]     [Fedora SELinux]     [Yosemite Discussion]     [KDE Users]     [Fedora Docs]

  Powered by Linux