diff mbox

Subject: [PATCH 1/1] multipath-tools: fix dm- device filtering

Message ID CAAZtj82kfWDjnqLYbqi==BRGukYQXCV=mTR3hmD6XOiD-C3-0Q@mail.gmail.com (mailing list archive)
State Not Applicable, archived
Delegated to: christophe varoqui
Headers show

Commit Message

Dragan Stancevic June 23, 2016, 9:06 p.m. UTC
Hi Christophe,

can you please take a look at the attached patch, we are seeing quite a few
cases with the following errors:

failed to get udev uid: Invalid argument
failed to get sysfs uid: Invalid argument
failed to get sgio uid: No such file or directory

It causes a lot of confusion because the devices in question are in the
blacklist but aren't getting filtered. I don't know the code well enough,
but it seems that maybe there should be no condition in the filtering and
the code should just be:
if (dev && (filter_devnode(conf->blist_devnode, conf->elist_devnode, dev) >
0)) {

But I went for smaller change option, by just allowing DEV_UEVENT to also
be filtered.

What do you think?

Thanks.
--
dm-devel mailing list
dm-devel@redhat.com
https://www.redhat.com/mailman/listinfo/dm-devel

Comments

Christophe Varoqui July 8, 2016, 6:55 a.m. UTC | #1
Hannes, Ben, do you ack this one ?

On Thu, Jun 23, 2016 at 11:06 PM, Dragan Stancevic <
dragan.stancevic@canonical.com> wrote:

> Hi Christophe,
>
> can you please take a look at the attached patch, we are seeing quite a
> few cases with the following errors:
>
> failed to get udev uid: Invalid argument
> failed to get sysfs uid: Invalid argument
> failed to get sgio uid: No such file or directory
>
> It causes a lot of confusion because the devices in question are in the
> blacklist but aren't getting filtered. I don't know the code well enough,
> but it seems that maybe there should be no condition in the filtering and
> the code should just be:
> if (dev && (filter_devnode(conf->blist_devnode, conf->elist_devnode, dev)
> > 0)) {
>
> But I went for smaller change option, by just allowing DEV_UEVENT to also
> be filtered.
>
> What do you think?
>
> Thanks.
>
--
dm-devel mailing list
dm-devel@redhat.com
https://www.redhat.com/mailman/listinfo/dm-devel
Benjamin Marzinski July 8, 2016, 6:05 p.m. UTC | #2
On Fri, Jul 08, 2016 at 08:55:38AM +0200, Christophe Varoqui wrote:

ACK

-Ben

>    Hannes, Ben, do you ack this one ?
>    On Thu, Jun 23, 2016 at 11:06 PM, Dragan Stancevic
>    <[1]dragan.stancevic@canonical.com> wrote:
> 
>      Hi Christophe,
>      can you please take a look at the attached patch, we are seeing quite a
>      few cases with the following errors:
>      failed to get udev uid: Invalid argument
>      failed to get sysfs uid: Invalid argument
>      failed to get sgio uid: No such file or directory
>      It causes a lot of confusion because the devices in question are in the
>      blacklist but aren't getting filtered. I don't know the code well
>      enough, but it seems that maybe there should be no condition in the
>      filtering and the code should just be:
>      if (dev && (filter_devnode(conf->blist_devnode, conf->elist_devnode,
>      dev) > 0)) {
>      But I went for smaller change option, by just allowing DEV_UEVENT to
>      also be filtered.
>      What do you think?
>      Thanks.
> 
> References
> 
>    Visible links
>    1. mailto:dragan.stancevic@canonical.com

> --
> dm-devel mailing list
> dm-devel@redhat.com
> https://www.redhat.com/mailman/listinfo/dm-devel

--
dm-devel mailing list
dm-devel@redhat.com
https://www.redhat.com/mailman/listinfo/dm-devel
diff mbox

Patch

From 7dcf982221f1aa63226babaee2c41d8b0652b6d8 Mon Sep 17 00:00:00 2001
From: Dragan Stancevic <dragan.stancevic@canonical.com>
Date: Thu, 23 Jun 2016 15:29:37 -0500
Subject: [PATCH 1/1] multipath-tools: fix dm- device filtering

During "service multipath-tools start" /sbin/multipath is
called on dm- devices that are filtered but due to a condition
conf->dev_type == DEV_DEVNODE in filtering code multipath
binary wasn't dropping out when hitting a dm- device. This
was due to the fact that in this case conf->dev_type is
set to DEV_UEVENT.

This is causing the logs to be filled with following
messages:

multipath: dm-6: failed to get udev uid: Invalid argument
multipath: dm-6: failed to get sysfs uid: Invalid argument
multipath: dm-6: failed to get sgio uid: No such file or directory

This change alows the filtering to happen.

Cc: Christophe Varoqui <christophe.varoqui@opensvc.com>
Cc: device-mapper development <dm-devel@redhat.com>

Signed-off-by: Dragan Stancevic <dragan.stancevic@canonical.com>
---
 multipath/main.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/multipath/main.c b/multipath/main.c
index aadebec..d89298b 100644
--- a/multipath/main.c
+++ b/multipath/main.c
@@ -267,7 +267,8 @@  configure (void)
 	/*
 	 * if we have a blacklisted device parameter, exit early
 	 */
-	if (dev && conf->dev_type == DEV_DEVNODE &&
+	if (dev && (conf->dev_type == DEV_DEVNODE ||
+		    conf->dev_type == DEV_UEVENT) &&
 	    conf->cmd != CMD_REMOVE_WWID &&
 	    (filter_devnode(conf->blist_devnode,
 			    conf->elist_devnode, dev) > 0)) {
-- 
2.1.0