multipathd: ignore uevents for non-mpath devices
authorMartin Wilck <mwilck@suse.com>
Mon, 29 Jan 2018 23:57:50 +0000 (00:57 +0100)
committerChristophe Varoqui <christophe.varoqui@opensvc.com>
Wed, 7 Mar 2018 08:40:21 +0000 (09:40 +0100)
multipathd can't deal with other devices anyway. Proceeding further
with events for other devices just generates log noise.

Based on an idea from Ritika Srivastava <ritika.srivastava@oracle.com>.
("multipath-tools: Skip CHANGE uevent for non-mpath devices").

Changes in v2: always return immediately for non-mpath case
  (Ritika Srivastava)

Signed-off-by: Martin Wilck <mwilck@suse.com>
multipathd/main.c

index ff3ecb6..a8a0c30 100644 (file)
@@ -1122,6 +1122,8 @@ uev_trigger (struct uevent * uev, void * trigger_data)
         * are not fully initialised then.
         */
        if (!strncmp(uev->kernel, "dm-", 3)) {
+               if (!uevent_is_mpath(uev))
+                       goto out;
                if (!strncmp(uev->action, "change", 6)) {
                        r = uev_add_map(uev, vecs);
 
@@ -1132,11 +1134,8 @@ uev_trigger (struct uevent * uev, void * trigger_data)
                         * cess.
                         */
                        uev_pathfail_check(uev, vecs);
-                       goto out;
-               }
-               if (!strncmp(uev->action, "remove", 6)) {
+               } else if (!strncmp(uev->action, "remove", 6)) {
                        r = uev_remove_map(uev, vecs);
-                       goto out;
                }
                goto out;
        }