[prev in list] [next in list] [prev in thread] [next in thread] 

List:       dm-devel
Subject:    Re: [dm-devel] [PATCH] multipath: fix multipath -l <devmap> without output
From:       Christophe Varoqui <christophe.varoqui () opensvc ! com>
Date:       2016-07-31 8:57:44
Message-ID: CABr-GncKxQGA-wPnnUvbmiyBek332jAZ3CSc6ZO+XEQw58YaOw () mail ! gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


Merged.
Thanks.

On Mon, Jul 25, 2016 at 3:41 PM, Mauricio Faria de Oliveira <
mauricfo@linux.vnet.ibm.com> wrote:

> Currently, the multipath -l <devmap> output is empty, and an error
> is printed to syslog:
>
>     # ./multipath -l mpatha
>     #
>
>     # echo $?
>     1
>
>     # tail /var/log/messages
>     ...
>     ... multipath: mpatha: can't get udev device
>
> That's due to dev_type not being initialized, and incorrectly evaluated.
> So, initialize it to DEV_NONE, which is verified/reset by get_dev_type().
>
> Now there's actual output and no error in syslog:
>
>     # ./multipath -l mpatha
>     mpatha (3600a0b800011e95c000055d855167d1c) dm-0 IBM,1815      FAStT
>     ...
>
>     # echo $?
>     0
>
> Signed-off-by: Mauricio Faria de Oliveira <mauricfo@linux.vnet.ibm.com>
>
> (tested on '2613ce0 Bump version code to 0.6.2')
> ---
>  multipath/main.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/multipath/main.c b/multipath/main.c
> index 6ccece7..93376a9 100644
> --- a/multipath/main.c
> +++ b/multipath/main.c
> @@ -511,7 +511,7 @@ main (int argc, char *argv[])
>         extern int optind;
>         int r = 1;
>         enum mpath_cmds cmd = CMD_CREATE;
> -       enum devtypes dev_type;
> +       enum devtypes dev_type = DEV_NONE;
>         char *dev = NULL;
>         struct config *conf;
>
> --
> 1.8.3.1
>
>

[Attachment #5 (text/html)]

<div dir="ltr">Merged.<div>Thanks.</div></div><div class="gmail_extra"><br><div \
class="gmail_quote">On Mon, Jul 25, 2016 at 3:41 PM, Mauricio Faria de Oliveira <span \
dir="ltr">&lt;<a href="mailto:mauricfo@linux.vnet.ibm.com" \
target="_blank">mauricfo@linux.vnet.ibm.com</a>&gt;</span> wrote:<br><blockquote \
class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc \
solid;padding-left:1ex">Currently, the multipath -l &lt;devmap&gt; output is empty, \
and an error<br> is printed to syslog:<br>
<br>
      # ./multipath -l mpatha<br>
      #<br>
<br>
      # echo $?<br>
      1<br>
<br>
      # tail /var/log/messages<br>
      ...<br>
      ... multipath: mpatha: can&#39;t get udev device<br>
<br>
That&#39;s due to dev_type not being initialized, and incorrectly evaluated.<br>
So, initialize it to DEV_NONE, which is verified/reset by get_dev_type().<br>
<br>
Now there&#39;s actual output and no error in syslog:<br>
<br>
      # ./multipath -l mpatha<br>
      mpatha (3600a0b800011e95c000055d855167d1c) dm-0 IBM,1815         FAStT<br>
      ...<br>
<br>
      # echo $?<br>
      0<br>
<br>
Signed-off-by: Mauricio Faria de Oliveira &lt;<a \
href="mailto:mauricfo@linux.vnet.ibm.com">mauricfo@linux.vnet.ibm.com</a>&gt;<br> \
<br> (tested on &#39;2613ce0 Bump version code to 0.6.2&#39;)<br>
---<br>
  multipath/main.c | 2 +-<br>
  1 file changed, 1 insertion(+), 1 deletion(-)<br>
<br>
diff --git a/multipath/main.c b/multipath/main.c<br>
index 6ccece7..93376a9 100644<br>
--- a/multipath/main.c<br>
+++ b/multipath/main.c<br>
@@ -511,7 +511,7 @@ main (int argc, char *argv[])<br>
            extern int optind;<br>
            int r = 1;<br>
            enum mpath_cmds cmd = CMD_CREATE;<br>
-           enum devtypes dev_type;<br>
+           enum devtypes dev_type = DEV_NONE;<br>
            char *dev = NULL;<br>
            struct config *conf;<br>
<span class="HOEnZb"><font color="#888888"><br>
--<br>
1.8.3.1<br>
<br>
</font></span></blockquote></div><br></div>



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

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic