Skip to contentSkip to conversation

some minor multipath-tools fixes

PATCH New Martin Wilck 1 participant 4 messages Aug 14, 2017 Device mapper

lore
Share & tools
lore
#0 lore raw

cover some minor multipath-tools fixes

Fix some glitches that were discovered recently here at SUSE.

Martin Wilck (3):
kpartx/devmapper.h: remove dm_no_partitions
libmultipath: cli_add_map: Use CMD_NONE
multipath-tools: link internal libraries before foreigns

 kpartx/devmapper.h        | 1 -
 mpathpersist/Makefile     | 4 ++--
 multipath/Makefile        | 4 ++--
 multipathd/Makefile       | 4 ++--
 multipathd/cli_handlers.c | 2 +-
 5 files changed, 7 insertions(+), 8 deletions(-)
Signature · 1 line
2.14.0
#1 lore raw

PATCH 1/3 kpartx/devmapper.h: remove dm_no_partitions

This removes the deleted function from the header file.

Fixes 2ea69fc9 'kpartx: remove "no_partitions" support'
---
 kpartx/devmapper.h | 1 -
 1 file changed, 1 deletion(-)
kpartx/devmapper.h +0 -1
index 2e28c780..f00373e0 100644
@@ -19,6 +19,5 @@ dev_t dm_get_first_dep(char *devname);
 char * dm_mapuuid(const char *mapname);
 int dm_devn (const char * mapname, int *major, int *minor);
 int dm_remove_partmaps (char * mapname, char *uuid, dev_t devt, int verbose);
-int dm_no_partitions(char * mapname);
 
 #endif /* _KPARTX_DEVMAPPER_H */
Signature · 1 line
2.14.0
#2 lore raw

PATCH 2/3 libmultipath: cli_add_map: Use CMD_NONE

In reply to Martin Wilck

Commands issued from the daemon itself should always pass CMD_NONE to coalesce_paths. Otherwise, the daemon mistakenly tries to talk to itself via the socket, causing deadlock.

Reproduce simply by calling "multipathd add map $X".

Fixes d19936f4 "libmultipath: Do not access 'conf->cmd' in domap()"
---
 multipathd/cli_handlers.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
multipathd/cli_handlers.c +1 -1
index b4a95e37..f5ba4cfb 100644
@@ -782,7 +782,7 @@ cli_add_map (void * v, char ** reply, int * len, void * data)
 					 vecs->pathvec, &refwwid);
 			if (refwwid) {
 				if (coalesce_paths(vecs, NULL, refwwid,
-						   FORCE_RELOAD_NONE, 1))
+						   FORCE_RELOAD_NONE, CMD_NONE))
 					condlog(2, "%s: coalesce_paths failed",
 									param);
 				dm_lib_release();
Signature · 1 line
2.14.0
#3 lore raw

PATCH 3/3 multipath-tools: link internal libraries before foreigns

In reply to Martin Wilck

Otherwise, the runtime linker may resolve foreign symbols instead of internal ones for certain symbol names (observed with xfree() from libreadline).

---
 mpathpersist/Makefile | 4 ++--
 multipath/Makefile    | 4 ++--
 multipathd/Makefile   | 4 ++--
 3 files changed, 6 insertions(+), 6 deletions(-)
mpathpersist/Makefile +2 -2
index bd1c0df9..6e5acd3b 100644
@@ -3,8 +3,8 @@ include ../Makefile.inc
 CFLAGS += $(BIN_CFLAGS) -I$(multipathdir) -I$(mpathpersistdir)
 LDFLAGS += $(BIN_LDFLAGS)
 
-LIBDEPS += -lpthread -ldevmapper -L$(mpathpersistdir) -lmpathpersist \
-	   -L$(multipathdir) -L$(mpathcmddir) -lmpathcmd -lmultipath -ludev
+LIBDEPS += -L$(mpathpersistdir) -lmpathpersist -L$(multipathdir) -lmultipath \
+	-L$(mpathcmddir) -lmpathcmd -lpthread -ldevmapper -ludev
 
 EXEC = mpathpersist
 
multipath/Makefile +2 -2
index c85314e3..468c056d 100644
@@ -5,8 +5,8 @@ include ../Makefile.inc
 
 CFLAGS += $(BIN_CFLAGS) -I$(multipathdir) -I$(mpathcmddir)
 LDFLAGS += $(BIN_LDFLAGS)
-LIBDEPS += -lpthread -ldevmapper -ldl -L$(multipathdir) -lmultipath -ludev \
-	   -L$(mpathcmddir) -lmpathcmd
+LIBDEPS += -L$(multipathdir) -lmultipath -L$(mpathcmddir) -lmpathcmd \
+	-lpthread -ldevmapper -ldl -ludev
 
 EXEC = multipath
 
multipathd/Makefile +2 -2
index d5782a18..e6f140bf 100644
@@ -9,8 +9,8 @@ include ../Makefile.inc
 CFLAGS += $(BIN_CFLAGS) -I$(multipathdir) -I$(mpathpersistdir) \
 	  -I$(mpathcmddir) -I$(thirdpartydir)
 LDFLAGS += $(BIN_LDFLAGS)
-LIBDEPS += -ludev -ldl -L$(multipathdir) -lmultipath -L$(mpathpersistdir) \
-	   -lmpathpersist -L$(mpathcmddir) -lmpathcmd -lurcu -lpthread \
+LIBDEPS += -L$(multipathdir) -lmultipath -L$(mpathpersistdir) -lmpathpersist \
+	   -L$(mpathcmddir) -lmpathcmd -ludev -ldl -lurcu -lpthread \
 	   -ldevmapper -lreadline
 
 ifdef SYSTEMD
Signature · 1 line
2.14.0