diff mbox

[7/7] multipathd: ignore uevents for non-mpath devices

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

Commit Message

Martin Wilck Jan. 17, 2018, 7:49 a.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").

Signed-off-by: Martin Wilck <mwilck@suse.com>
---
 multipathd/main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Ritika Srivastava Jan. 29, 2018, 10:25 p.m. UTC | #1
On 01/16/2018 11:49 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").
>
> Signed-off-by: Martin Wilck <mwilck@suse.com>
> ---
>   multipathd/main.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/multipathd/main.c b/multipathd/main.c
> index ff3ecb640487..26632291657f 100644
> --- a/multipathd/main.c
> +++ b/multipathd/main.c
> @@ -1121,7 +1121,7 @@ uev_trigger (struct uevent * uev, void * trigger_data)
>   	 * Add events are ignored here as the tables
>   	 * are not fully initialised then.
>   	 */
> -	if (!strncmp(uev->kernel, "dm-", 3)) {
> +	if (!strncmp(uev->kernel, "dm-", 3) && uevent_is_mpath(uev)) {
>   		if (!strncmp(uev->action, "change", 6)) {
>   			r = uev_add_map(uev, vecs);
>   

Hi Martin,
Thank you for the updated patch.
With this patch, the error "uevent trigger error" would not be 
encountered when removing lvm snapshots.

However, when the uevent is for a 'dm' device but not for a multipath 
device, then should we just return from this check in uev_trigger()?
With this patch, uev_update_path()/uev_remove_path() would still be 
called which would generate further log.
Should we avoid these function calls too?
Martin Wilck Jan. 29, 2018, 11:44 p.m. UTC | #2
On Mon, 2018-01-29 at 14:25 -0800, Ritika Srivastava wrote:
> On 01/16/2018 11:49 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.c
> > om>.
> > ("multipath-tools: Skip CHANGE uevent for non-mpath devices").
> > 
> > Signed-off-by: Martin Wilck <mwilck@suse.com>
> > ---
> >   multipathd/main.c | 2 +-
> >   1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/multipathd/main.c b/multipathd/main.c
> > index ff3ecb640487..26632291657f 100644
> > --- a/multipathd/main.c
> > +++ b/multipathd/main.c
> > @@ -1121,7 +1121,7 @@ uev_trigger (struct uevent * uev, void *
> > trigger_data)
> >   	 * Add events are ignored here as the tables
> >   	 * are not fully initialised then.
> >   	 */
> > -	if (!strncmp(uev->kernel, "dm-", 3)) {
> > +	if (!strncmp(uev->kernel, "dm-", 3) &&
> > uevent_is_mpath(uev)) {
> >   		if (!strncmp(uev->action, "change", 6)) {
> >   			r = uev_add_map(uev, vecs);
> >   
> 
> Hi Martin,
> Thank you for the updated patch.
> With this patch, the error "uevent trigger error" would not be 
> encountered when removing lvm snapshots.
> 
> However, when the uevent is for a 'dm' device but not for a
> multipath 
> device, then should we just return from this check in uev_trigger()?
> With this patch, uev_update_path()/uev_remove_path() would still be 
> called which would generate further log.
> Should we avoid these function calls too?

You are right, thanks for pointing that out. I'll post an update.

Martin
diff mbox

Patch

diff --git a/multipathd/main.c b/multipathd/main.c
index ff3ecb640487..26632291657f 100644
--- a/multipathd/main.c
+++ b/multipathd/main.c
@@ -1121,7 +1121,7 @@  uev_trigger (struct uevent * uev, void * trigger_data)
 	 * Add events are ignored here as the tables
 	 * are not fully initialised then.
 	 */
-	if (!strncmp(uev->kernel, "dm-", 3)) {
+	if (!strncmp(uev->kernel, "dm-", 3) && uevent_is_mpath(uev)) {
 		if (!strncmp(uev->action, "change", 6)) {
 			r = uev_add_map(uev, vecs);