[dm-devel] [PATCH 2/3] libmultipath: coalesce_paths(): stop triggering spurious uevents

mwilck at suse.com mwilck at suse.com
Fri Jan 8 17:00:43 UTC 2021


From: Martin Wilck <mwilck at suse.com>

Since 0d66e03 ("libmultipath: force map reload if udev incomplete"), we
force-reload maps that we find incompletely initialized by udev. If
select_action returns ACT_NOTHING nonetheless, the map must be initialized
in udev, and thus and "add" uevent must have been seen already. Triggering
this event once more is unlikely to fix anything for real.

Reverts: b516118 ("libmultipath: coalesce_paths: trigger uevent if nothing done")
Signed-off-by: Martin Wilck <mwilck at suse.com>
---
 libmultipath/configure.c | 24 ------------------------
 1 file changed, 24 deletions(-)

diff --git a/libmultipath/configure.c b/libmultipath/configure.c
index 999f310..3263bb0 100644
--- a/libmultipath/configure.c
+++ b/libmultipath/configure.c
@@ -527,18 +527,6 @@ get_udev_for_mpp(const struct multipath *mpp)
 	return udd;
 }
 
-static void
-trigger_udev_change(const struct multipath *mpp)
-{
-	static const char change[] = "change";
-	struct udev_device *udd = get_udev_for_mpp(mpp);
-	if (!udd)
-		return;
-	condlog(3, "triggering %s uevent for %s", change, mpp->alias);
-	sysfs_attr_set_value(udd, "uevent", change, sizeof(change)-1);
-	udev_device_unref(udd);
-}
-
 static void trigger_partitions_udev_change(struct udev_device *dev,
 					   const char *action, int len)
 {
@@ -1297,18 +1285,6 @@ int coalesce_paths (struct vectors *vecs, vector mpvec, char *refwwid,
 			continue;
 		}
 
-		if (r == DOMAP_EXIST && mpp->action == ACT_NOTHING &&
-		    force_reload == FORCE_RELOAD_WEAK)
-			/*
-			 * First time we're called, and no changes applied.
-			 * domap() was a noop. But we can't be sure that
-			 * udev has already finished setting up this device
-			 * (udev in initrd may have been shut down while
-			 * processing this device or its children).
-			 * Trigger a change event, just in case.
-			 */
-			trigger_udev_change(find_mp_by_wwid(curmp, mpp->wwid));
-
 		conf = get_multipath_config();
 		allow_queueing = conf->allow_queueing;
 		put_multipath_config(conf);
-- 
2.29.2





More information about the dm-devel mailing list