All of lore.kernel.org
 help / color / mirror / Atom feed
* [multipath-tools] [patch] fix select_alias weirdness
@ 2006-06-01  1:09 Benjamin Marzinski
  2006-06-01 18:38 ` Christophe Varoqui
  0 siblings, 1 reply; 2+ messages in thread
From: Benjamin Marzinski @ 2006-06-01  1:09 UTC (permalink / raw)
  To: dm-devel

[-- Attachment #1: Type: text/plain, Size: 185 bytes --]

In select_alias, the code that tries to pull the alias from dm_get_name()
sets mp->alias. So even if it fails,  mp->alias will never get set to mp->wwid. 

This patch fixes that.

-Ben

[-- Attachment #2: alias_fix.patch --]
[-- Type: text/plain, Size: 836 bytes --]

diff -urpN mp-devel-clean/libmultipath/propsel.c mp-devel-patched/libmultipath/propsel.c
--- mp-devel-clean/libmultipath/propsel.c	2006-05-23 11:12:15.000000000 -0500
+++ mp-devel-patched/libmultipath/propsel.c	2006-05-31 13:33:13.000000000 -0500
@@ -165,10 +165,16 @@ select_alias (struct multipath * mp)
 		if (conf->user_friendly_names)
 			mp->alias = get_user_friendly_alias(mp->wwid,
 					conf->bindings_file);
-		if (mp->alias == NULL)
-			if ((mp->alias = MALLOC(WWID_SIZE)) != NULL)
-				dm_get_name(mp->wwid, DEFAULT_TARGET,
-					    mp->alias);
+		if (mp->alias == NULL){
+			char *alias;
+			if ((alias = MALLOC(WWID_SIZE)) != NULL){
+				if (dm_get_name(mp->wwid, DEFAULT_TARGET,
+						alias) == 1)
+					mp->alias = alias;
+				else
+					FREE(alias);
+			}
+		}
 		if (mp->alias == NULL)
 			mp->alias = mp->wwid;
 	}

[-- Attachment #3: Type: text/plain, Size: 0 bytes --]



^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [multipath-tools] [patch] fix select_alias weirdness
  2006-06-01  1:09 [multipath-tools] [patch] fix select_alias weirdness Benjamin Marzinski
@ 2006-06-01 18:38 ` Christophe Varoqui
  0 siblings, 0 replies; 2+ messages in thread
From: Christophe Varoqui @ 2006-06-01 18:38 UTC (permalink / raw)
  To: device-mapper development

Le mercredi 31 mai 2006 à 20:09 -0500, Benjamin Marzinski a écrit :
> In select_alias, the code that tries to pull the alias from dm_get_name()
> sets mp->alias. So even if it fails,  mp->alias will never get set to mp->wwid. 
> 
> This patch fixes that.
> 
Right. Applied.

Regards,
cvaroqui

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2006-06-01 18:38 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-06-01  1:09 [multipath-tools] [patch] fix select_alias weirdness Benjamin Marzinski
2006-06-01 18:38 ` Christophe Varoqui

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.