[lvm-devel] [PATCH] dmeventd: fix dso name wrong compare

Lidong Zhong lzhong at suse.com
Wed Jul 8 03:30:49 UTC 2015


Hi list,

dmevent_tool won't work without this patch. Could somebody help to
review this patch?

Thanks,
Lidong

>>> On 6/26/2015 at 05:16 PM, in message
<1435310166-2418-1-git-send-email-lzhong at suse.com>, Lidong Zhong
<lzhong at suse.com> wrote: 
> If the dso name is not set in client, then it will be replaced by "-". 
> So the server should compare the dso name with "-" to decide whether 
> it is set. 
> --- 
>  daemons/dmeventd/dmeventd.c | 4 ++-- 
>  1 file changed, 2 insertions(+), 2 deletions(-) 
>  
> diff --git a/daemons/dmeventd/dmeventd.c b/daemons/dmeventd/dmeventd.c 
> index fcfa423..d81c4ee 100644 
> --- a/daemons/dmeventd/dmeventd.c 
> +++ b/daemons/dmeventd/dmeventd.c 
> @@ -1190,12 +1190,12 @@ static int _want_registered_device(char *dso_name,  
> char *device_uuid, 
>  				   struct thread_status *thread) 
>  { 
>  	/* If DSO names and device paths are equal. */ 
> -	if (dso_name && device_uuid) 
> +	if (strcmp(dso_name,"-") && device_uuid) 
>  		return !strcmp(dso_name, thread->dso_data->dso_name) && 
>  		    !strcmp(device_uuid, thread->device.uuid); 
>   
>  	/* If DSO names are equal. */ 
> -	if (dso_name) 
> +	if (strcmp(dso_name, "-")) 
>  		return !strcmp(dso_name, thread->dso_data->dso_name); 
>   
>  	/* If device paths are equal. */ 
 






More information about the lvm-devel mailing list