diff mbox

[v2] multipathd: ignore uevents for non-mpath devices

Message ID 20180129235750.28425-1-mwilck@suse.com (mailing list archive)
State Not Applicable, archived
Delegated to: christophe varoqui
Headers show

Commit Message

Martin Wilck Jan. 29, 2018, 11:57 p.m. UTC
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 | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

Comments

Ritika Srivastava Feb. 7, 2018, 7:14 p.m. UTC | #1
On 01/29/2018 03:57 PM, Martin Wilck wrote:
> 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 | 7 +++----
>   1 file changed, 3 insertions(+), 4 deletions(-)
>
> diff --git a/multipathd/main.c b/multipathd/main.c
> index ff3ecb640487..a8a0c302e8fe 100644
> --- a/multipathd/main.c
> +++ b/multipathd/main.c
> @@ -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;
>   	}
The updated patch looks good.

Reviewed-by: Ritika Srivastava <ritika.srivastava@oracle.com>
diff mbox

Patch

diff --git a/multipathd/main.c b/multipathd/main.c
index ff3ecb640487..a8a0c302e8fe 100644
--- a/multipathd/main.c
+++ b/multipathd/main.c
@@ -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;
 	}