Skip to contentSkip to conversation

main - lvmdevices update: correct multipath entries

PATCH David Teigland 1 participant 1 message Apr 1, 2022

lore
Share & tools
lore
#0 lore raw
Gitweb:        https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=23a9bd549a27cba63c525e7b3042a67e428c798f
Commit:        23a9bd549a27cba63c525e7b3042a67e428c798f
Parent:        6e22be20c66b85ee161d170571c65b0f383010e4
Author:        David Teigland <[email protected]>
AuthorDate:    Wed Mar 30 16:28:35 2022 -0500
Committer:     David Teigland <[email protected]>
CommitterDate: Fri Apr 1 13:38:21 2022 -0500

lvmdevices update: correct multipath entries

Remove multipath components.
Add multipath devs that have multipath components listed.

---
 lib/filters/filter-mpath.c |  6 ++++++
 tools/lvmdevices.c         | 43 +++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 49 insertions(+)
lib/filters/filter-mpath.c +6 -0
index fc7cc51fa..854c26a7c 100644
@@ -21,6 +21,8 @@
 
 #include <dirent.h>
 
+static int _lvmdevices_update_msg;
+
 static int _ignore_mpath_component(struct cmd_context *cmd, struct dev_filter *f, struct device *dev, const char *use_filter_name)
 {
 	dev_t mpath_devno = 0;
@@ -41,6 +43,10 @@ static int _ignore_mpath_component(struct cmd_context *cmd, struct dev_filter *f
 				log_warn("WARNING: devices file is missing %s (%d:%d) using multipath component %s.",
 					 mpath_dev ? dev_name(mpath_dev) : "unknown",
 					 (int)MAJOR(mpath_devno), (int)MINOR(mpath_devno), dev_name(dev));
+				if (!_lvmdevices_update_msg && strcmp(get_cmd_name(), "lvmdevices")) {
+					log_warn("See lvmdevices --update for devices file update.");
+					_lvmdevices_update_msg = 1;
+				}
 			}
 		}
 
tools/lvmdevices.c +43 -0

61 lines not on this page · raw message