<font size=2 face="sans-serif">Hello Ben,</font>
<br>
<br><tt><font size=2>> Right now, multipath users are allowed configure
devices to set the wwid<br>
> based on any udev environment variable (or even use a callout, although<br>
> this is deprecated). With this patch, that breaks.</font></tt>
<br><font size=2 face="sans-serif">Does </font><font size=2>WWID</font><font size=2 face="sans-serif">
obtained by different methods change? If it changes, we would </font>
<br><font size=2 face="sans-serif">better to modify code to keep it no
change. </font>
<br>
<br><tt><font size=2>> If the udev sets<br>
> ID_SERIAL for a device, that is its wwid, right? </font></tt>
<br><tt><font size=2>Yes</font></tt>
<br>
<br><tt><font size=2>> Do you know if rbd<br>
> devices have ID_SERIAL set? </font></tt>
<br><tt><font size=2>WWID has different label in uevents for different
devices, I only test for</font></tt>
<br><tt><font size=2>SCSI devices. Now we do not support rbd divice for
uevents merging, these </font></tt>
<br><tt><font size=2>device process as old way, it has no harm in logic.
If we need to merge </font></tt>
<br><tt><font size=2>rbd uevents for these devices, we can add code to
get wwid from uevents</font></tt>
<br><tt><font size=2>and it can be supported easily. </font></tt>
<br>
<br>
<br><font size=2 face="sans-serif">Regards</font>
<br><font size=2 face="sans-serif">Tang Junhui</font>
<br>
<br>
<br>
<br>
<br>
<br><font size=1 color=#5f5f5f face="sans-serif">发件人:    
    </font><font size=1 face="sans-serif">"Benjamin
Marzinski" <bmarzins@redhat.com></font>
<br><font size=1 color=#5f5f5f face="sans-serif">收件人:    
    </font><font size=1 face="sans-serif">tang.junhui@zte.com.cn,
</font>
<br><font size=1 color=#5f5f5f face="sans-serif">抄送:    
   </font><font size=1 face="sans-serif">christophe.varoqui@opensvc.com,
hare@suse.de, mwilck@suse.com, bart.vanassche@sandisk.com, dm-devel@redhat.com,
zhang.kai16@zte.com.cn, tang.wenjun3@zte.com.cn</font>
<br><font size=1 color=#5f5f5f face="sans-serif">日期:    
    </font><font size=1 face="sans-serif">2017/01/04
06:03</font>
<br><font size=1 color=#5f5f5f face="sans-serif">主题:    
   </font><font size=1 face="sans-serif">Re: [PATCH 01/12]
libmultipath: add wwid for "struct uevent" to record wwid of
uevent</font>
<br>
<hr noshade>
<br>
<br>
<br><tt><font size=2>On Tue, Dec 27, 2016 at 04:03:18PM +0800, tang.junhui@zte.com.cn
wrote:<br>
> From: tang.junhui <tang.junhui@zte.com.cn><br>
> <br>
> Add "char *wwid" to point WWID of uevent. This member identifies<br>
> the LUN ID which the path belongs to, and it is used for merging<br>
> uevents. WWID possibly did not exist in uevent yet, so ->wwid<br>
> would be NULL, those uevents would not be merged, but be proccessed<br>
> as old way.<br>
<br>
Right now, multipath users are allowed configure devices to set the wwid<br>
based on any udev environment variable (or even use a callout, although<br>
this is deprecated). With this patch, that breaks. If the udev sets<br>
ID_SERIAL for a device, that is its wwid, right?  Do you know if rbd<br>
devices have ID_SERIAL set? If so, this change will break them.  Even
if<br>
this change doesn't break any devices in their default configurations,<br>
we would need to disallow changing how the wwid is set for this patch<br>
to be safe.<br>
<br>
-Ben <br>
<br>
> <br>
> Change-Id: Ie6b076363b3735dc7de10184b27fa799b499af0e<br>
> Signed-off-by: tang.junhui <tang.junhui@zte.com.cn><br>
> ---<br>
>  libmultipath/uevent.c | 2 ++<br>
>  libmultipath/uevent.h | 1 +<br>
>  2 files changed, 3 insertions(+)<br>
> <br>
> diff --git a/libmultipath/uevent.c b/libmultipath/uevent.c<br>
> index 7edcce1..ef1bafe 100644<br>
> --- a/libmultipath/uevent.c<br>
> +++ b/libmultipath/uevent.c<br>
> @@ -424,6 +424,8 @@ struct uevent *uevent_from_udev_device(struct
udev_device *dev)<br>
>                  
                 
               
uev->devpath = uev->envp[i] + 8;<br>
>                  
                 if
(strcmp(name, "ACTION") == 0)<br>
>                  
                 
               
uev->action = uev->envp[i] + 7;<br>
> +                
                 if
(strcmp(name, "ID_SERIAL") == 0)<br>
> +                
                 
               
uev->wwid = uev->envp[i] + 10;<br>
>                  
                 i++;<br>
>                  
                 if
(i == HOTPLUG_NUM_ENVP - 1)<br>
>                  
                 
               
break;<br>
> diff --git a/libmultipath/uevent.h b/libmultipath/uevent.h<br>
> index 9d22dcd..7bfccef 100644<br>
> --- a/libmultipath/uevent.h<br>
> +++ b/libmultipath/uevent.h<br>
> @@ -22,6 +22,7 @@ struct uevent {<br>
>                  
char *devpath;<br>
>                  
char *action;<br>
>                  
char *kernel;<br>
> +                
char *wwid;<br>
>                  
unsigned long seqnum;<br>
>                  
char *envp[HOTPLUG_NUM_ENVP];<br>
>  };<br>
> -- <br>
> 2.8.1.windows.1<br>
> <br>
</font></tt>
<br>