[dm-devel] Some issues noticed in my testing.

Caushik, Ramesh ramesh.caushik at intel.com
Mon Feb 7 23:18:17 UTC 2005


Hi Christophe,
I noticed a failure in multipath-tools-0.4.2 when executing the
following scenario.

i) Run multipathd & multipath with 1 of 2 paths in the system available.
ii)activate the other path.
iii) run multipath again.

Expect the newly inserted path to be incorporated into the original path
groups. Does not happen. Traced it to a problem in the pgcmp2 function.
Patch below should fix it. Also in step iii) above running multipath
with a parameter (conf->dev) will not include the additional path into
the particular mp because the select_alias function not called in the
coalesce_paths function so the strncmp(mpp->alias,conf->dev,....) in
main will always fail. Patch below should fix it. 

Also while testing with a modified scsi_debug driver (to expose multiple
paths to the same device) noticed that sysfs vendor name for the
scsi_debug device is "Linux   " which fails to match with a "Linux"
vendor name in the conf name and so device specific settings are not
picked up. Think it is a good idea to chomp off trailing whitespace from
vendor and product names. See patches below.  Regards,

Ramesh.

"Views expressed are mine, and not those of Intel Corporation" 


diff -r /home/rcaushik/multipath-tools-0.4.2/libmultipath/hwtable.c
multipath-tools-0.4.2/libmultipath/hwtable.c
11a12,13
> int  strcmp_chomp(char *str1, char *str2);
> 
20c22
< 		    strcmp(hwe->vendor, vendor) == 0 &&
---
> 		    strcmp_chomp(hwe->vendor, vendor) == 0 &&
22c24
< 			strcmp(hwe->product, product) == 0))
---
> 			strcmp_chomp(hwe->product, product) == 0))
58a61,64
> int  strcmp_chomp(char *str1, char *str2)
> {
> 	int i;
> 	char s1[PARAMS_SIZE],s2[PARAMS_SIZE];
59a66,76
>         if(!str1 || !str2)
> 		return 1;
> 	strncpy(s1,str1,PARAMS_SIZE);
> 	strncpy(s2,str2,PARAMS_SIZE);
> 		
> 	for(i=strlen(s1)-1;i >=0 && isspace(s1[i]); --i) ;
> 	s1[++i]='\0';
> 	for(i=strlen(s2)-1;i >=0 && isspace(s2[i]); --i) ;
> 	s2[++i]='\0';
> 	return(strcmp(s1,s2));
> }
diff -r /home/rcaushik/multipath-tools-0.4.2/multipath/main.c
multipath-tools-0.4.2/multipath/main.c
405c405
< 
---
> 		select_alias(mpp);
672c672
< 				break;
---
> 				/* break; */
        




More information about the dm-devel mailing list