[dm-devel] multipath bug and patch

Benjamin Marzinski bmarzins at redhat.com
Fri Nov 4 16:45:31 UTC 2016


On Thu, Nov 03, 2016 at 01:34:17PM -0500, James Shoemaker wrote:
>       If a device returns an empty string for inquiry data the current
>    multipath tool ignores it on reload.  I added the following patch and I
>    can hotplug these devices that don't return all the proper data.

I feel like returning "none" if you try and strchop an empty string is
pretty surprising behavior. I'd rather see this dealt with in the
function that has problems with the empty string.

-Ben

> 
>    diff --git a/libmultipath/util.c b/libmultipath/util.c
>    index ac0d1b2..045e660 100644
>    --- a/libmultipath/util.c
>    +++ b/libmultipath/util.c
>    @@ -17,6 +17,10 @@ strchop(char *str)
>     
>            for (i=strlen(str)-1; i >=0 && isspace(str[i]); --i) ;
>            str[++i] = '\0';
>    +       if(strlen(str)==0)
>    +       {
>    +               strcpy(str,"none");
>    +       }
>            return strlen(str);
>     }
> 
>    James Shoemaker

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




More information about the dm-devel mailing list