[dm-devel] [PATCH 01/12] libmultipath: add wwid for "struct uevent" to record wwid of uevent

tang.junhui at zte.com.cn tang.junhui at zte.com.cn
Wed Jan 4 06:56:46 UTC 2017


Hello Ben,

> Right now, multipath users are allowed configure devices to set the wwid
> based on any udev environment variable (or even use a callout, although
> this is deprecated). With this patch, that breaks.
Does WWID obtained by different methods change? If it changes, we would 
better to modify code to keep it no change. 

> If the udev sets
> ID_SERIAL for a device, that is its wwid, right? 
Yes

> Do you know if rbd
> devices have ID_SERIAL set? 
WWID has different label in uevents for different devices, I only test for
SCSI devices. Now we do not support rbd divice for uevents merging, these 
device process as old way, it has no harm in logic. If we need to merge 
rbd uevents for these devices, we can add code to get wwid from uevents
and it can be supported easily. 


Regards
Tang Junhui





发件人:         "Benjamin Marzinski" <bmarzins at redhat.com>
收件人:         tang.junhui at zte.com.cn, 
抄送:   christophe.varoqui at opensvc.com, hare at suse.de, mwilck at suse.com, 
bart.vanassche at sandisk.com, dm-devel at redhat.com, zhang.kai16 at zte.com.cn, 
tang.wenjun3 at zte.com.cn
日期:   2017/01/04 06:03
主题:   Re: [PATCH 01/12] libmultipath: add wwid for "struct uevent" to 
record wwid of uevent



On Tue, Dec 27, 2016 at 04:03:18PM +0800, tang.junhui at zte.com.cn wrote:
> From: tang.junhui <tang.junhui at zte.com.cn>
> 
> Add "char *wwid" to point WWID of uevent. This member identifies
> the LUN ID which the path belongs to, and it is used for merging
> uevents. WWID possibly did not exist in uevent yet, so ->wwid
> would be NULL, those uevents would not be merged, but be proccessed
> as old way.

Right now, multipath users are allowed configure devices to set the wwid
based on any udev environment variable (or even use a callout, although
this is deprecated). With this patch, that breaks. If the udev sets
ID_SERIAL for a device, that is its wwid, right?  Do you know if rbd
devices have ID_SERIAL set? If so, this change will break them.  Even if
this change doesn't break any devices in their default configurations,
we would need to disallow changing how the wwid is set for this patch
to be safe.

-Ben 

> 
> Change-Id: Ie6b076363b3735dc7de10184b27fa799b499af0e
> Signed-off-by: tang.junhui <tang.junhui at zte.com.cn>
> ---
>  libmultipath/uevent.c | 2 ++
>  libmultipath/uevent.h | 1 +
>  2 files changed, 3 insertions(+)
> 
> diff --git a/libmultipath/uevent.c b/libmultipath/uevent.c
> index 7edcce1..ef1bafe 100644
> --- a/libmultipath/uevent.c
> +++ b/libmultipath/uevent.c
> @@ -424,6 +424,8 @@ struct uevent *uevent_from_udev_device(struct 
udev_device *dev)
>                                                uev->devpath = 
uev->envp[i] + 8;
>                                if (strcmp(name, "ACTION") == 0)
>                                                uev->action = 
uev->envp[i] + 7;
> +                              if (strcmp(name, "ID_SERIAL") == 0)
> +                                              uev->wwid = uev->envp[i] 
+ 10;
>                                i++;
>                                if (i == HOTPLUG_NUM_ENVP - 1)
>                                                break;
> diff --git a/libmultipath/uevent.h b/libmultipath/uevent.h
> index 9d22dcd..7bfccef 100644
> --- a/libmultipath/uevent.h
> +++ b/libmultipath/uevent.h
> @@ -22,6 +22,7 @@ struct uevent {
>                char *devpath;
>                char *action;
>                char *kernel;
> +              char *wwid;
>                unsigned long seqnum;
>                char *envp[HOTPLUG_NUM_ENVP];
>  };
> -- 
> 2.8.1.windows.1
> 


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/dm-devel/attachments/20170104/6b558726/attachment.htm>


More information about the dm-devel mailing list