Skip to contentSkip to conversation

multipath-tools: important fixes for 0.7.5

PATCH In review Martin Wilck 4 participants 9 messages Mar 7, 2018 – Mar 27, 2018

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

cover multipath-tools: important fixes for 0.7.5

Hi Christophe,

thanks for catching up. This series fixes immediate problems with 0.7.5. The first one corresponds to my previously posted "[PATCH v3 2/2] multipathd: start marginal path checker thread lazily", and fixes a crash. The others fix the problens reported by Xose.

Regards
Martin

Martin Wilck (4):
libmultipath: fix crash on shutdown if io_err thread isn't running
multipathd: fix -Wpointer-to-int-cast warning in uxlsnr
multipath: fix clang warning in delegate_to_multipathd
multipath-tools: build: prevent intermediate file deletion

 Makefile.inc                       | 1 +
 libmultipath/checkers/Makefile     | 2 ++
 libmultipath/foreign/Makefile      | 2 ++
 libmultipath/io_err_stat.c         | 3 +++
 libmultipath/prioritizers/Makefile | 2 ++
 multipath/main.c                   | 2 +-
 multipathd/uxlsnr.c                | 4 ++--
 tests/Makefile                     | 5 ++---
 8 files changed, 15 insertions(+), 6 deletions(-)
Signature · 1 line
2.16.1
#1 lore raw

PATCH 1/4 libmultipath: fix crash on shutdown if io_err thread isn't running

If we've never created the io_error checker thread, we shouldn't cancel it.

Fixes 160da9fa4339 "multipathd: start marginal path checker thread

lazily"

---
 libmultipath/io_err_stat.c | 3 +++
 1 file changed, 3 insertions(+)
libmultipath/io_err_stat.c +3 -0
index ac81b4b9390d..02b1453ea527 100644
@@ -793,6 +793,9 @@ destroy_ctx:
 
 void stop_io_err_stat_thread(void)
 {
+	if (io_err_stat_thr == (pthread_t)0)
+		return;
+
 	if (uatomic_read(&io_err_thread_running) == 1)
 		pthread_cancel(io_err_stat_thr);
 
Signature · 1 line
2.16.1
#2 lore raw

PATCH 2/4 multipathd: fix -Wpointer-to-int-cast warning in uxlsnr

In reply to Martin Wilck
Fixes "multipathd: release uxsocket and resource when cancel thread"
---
 multipathd/uxlsnr.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
multipathd/uxlsnr.c +2 -2
index 0531061912b3..cdafd82943e7 100644
@@ -148,7 +148,7 @@ void uxsock_cleanup(void *arg)
 {
 	struct client *client_loop;
 	struct client *client_tmp;
-	int ux_sock = (int)arg;
+	long ux_sock = (long)arg;
 
 	close(ux_sock);
 
@@ -167,7 +167,7 @@ void uxsock_cleanup(void *arg)
  */
 void * uxsock_listen(uxsock_trigger_fn uxsock_trigger, void * trigger_data)
 {
-	int ux_sock;
+	long ux_sock;
 	int rlen;
 	char *inbuf;
 	char *reply;
Signature · 1 line
2.16.1
#3 lore raw

PATCH 3/4 multipath: fix clang warning in delegate_to_multipathd

In reply to Martin Wilck

Fixes this warning from clang:

main.c:628:11: warning: variable 'reply' is used uninitialized whenever 'if' condition is true [-Wsometimes-uninitialized]
...
main.c:609:32: note: initialize the variable 'reply' to silence this warning

Fixes 506d253b7f89 "multipath: delegate dangerous commands to multipathd"
---
 multipath/main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
multipath/main.c +1 -1
index 8732cf8bd930..716203eab56c 100644
@@ -606,7 +606,7 @@ int delegate_to_multipathd(enum mpath_cmds cmd, const char *dev,
 			   enum devtypes dev_type, const struct config *conf)
 {
 	int fd;
-	char command[1024], *p, *reply;
+	char command[1024], *p, *reply = NULL;
 	int n, r = 0;
 
 	fd = mpath_connect();
Signature · 1 line
2.16.1
#4 lore raw

PATCH 4/4 multipath-tools: build: prevent intermediate file deletion

In reply to Martin Wilck

By default, "make" removes intermediate files from implicit rules if they are the only dependency. Prevent that by using .SECONDARY. Otherwise some files will be re-built upon second invocation of "make".

Fixes e39283ebd79b "multipath-tools: add dependency tracking to Makefiles"
---
 Makefile.inc                       | 1 +
 libmultipath/checkers/Makefile     | 2 ++
 libmultipath/foreign/Makefile      | 2 ++
 libmultipath/prioritizers/Makefile | 2 ++
 tests/Makefile                     | 5 ++---
 5 files changed, 9 insertions(+), 3 deletions(-)
Makefile.inc +1 -0
index a5b9d4e3fa74..5d6123ded51a 100644
@@ -127,4 +127,5 @@ check_file = $(shell	\
 	)
 
 %.o:	%.c
+	@echo building $@ because of $?
 	$(CC) $(CFLAGS) -c -o $@ $<
libmultipath/checkers/Makefile +2 -0
index 9559038a770d..87c15bd777c3 100644
@@ -40,6 +40,8 @@ clean: dep_clean
 	$(RM) core *.a *.o *.gz *.so
 
 OBJS := $(LIBS:libcheck%.so=%.o) libsg.o directio.o
+.SECONDARY: $(OBJS)
+
 include $(wildcard $(OBJS:.o=.d))
 
 dep_clean:
libmultipath/foreign/Makefile +2 -0
index dfba11e86d76..fe98ddf7e4e9 100644
@@ -24,6 +24,8 @@ clean: dep_clean
 	$(RM) core *.a *.o *.gz *.so
 
 OBJS := $(LIBS:libforeign-%.so=%.o)
+.SECONDARY: $(OBJS)
+
 include $(wildcard $(OBJS:.o=.d))
 
 dep_clean:
libmultipath/prioritizers/Makefile +2 -0
index b3cc944c810d..ab7bc07572ec 100644
@@ -42,6 +42,8 @@ clean: dep_clean
 	$(RM) core *.a *.o *.gz *.so
 
 OBJS = $(LIBS:libprio%.so=%.o) alua_rtpg.o
+.SECONDARY: $(OBJS)
+
 include $(wildcard $(OBJS:.o=.d))
 
 dep_clean:
tests/Makefile +2 -3
index f6b55836a434..7ae6b9012b5a 100644
@@ -21,10 +21,9 @@ clean: dep_clean
 	rm -f $(TESTS:%=%-test) $(TESTS:%=%.out) $(TESTS:%=%.o)
 
 OBJS = $(TESTS:%=%.o)
+.SECONDARY: $(OBJS)
+
 include $(wildcard $(OBJS:.o=.d))
 
-
-
-
 dep_clean:
 	$(RM) $(OBJS:.o=.d)
Signature · 1 line
2.16.1
Tested-by on the v1 series
#5 lore raw
In reply to Martin Wilck
Quoted 7 lines · Martin Wilck

Hi Christophe,

thanks for catching up. This series fixes immediate problems with 0.7.5. The first one corresponds to my previously posted "[PATCH v3 2/2] multipathd: start marginal path checker thread lazily", and fixes a crash. The others fix the problens reported by Xose.

Quoted 5 lines

Regards
Martin

Martin Wilck (4):
libmultipath: fix crash on shutdown if io_err thread isn't running

These three:

Quoted 3 lines

multipathd: fix -Wpointer-to-int-cast warning in uxlsnr
multipath: fix clang warning in delegate_to_multipathd
multipath-tools: build: prevent intermediate file deletion

Quoted 10 lines
 Makefile.inc                       | 1 +
 libmultipath/checkers/Makefile     | 2 ++
 libmultipath/foreign/Makefile      | 2 ++
 libmultipath/io_err_stat.c         | 3 +++
 libmultipath/prioritizers/Makefile | 2 ++
 multipath/main.c                   | 2 +-
 multipathd/uxlsnr.c                | 4 ++--
 tests/Makefile                     | 5 ++---
 8 files changed, 15 insertions(+), 6 deletions(-)

Merge them ASAP, thanks.

#6 lore raw

The fixes and missing patches series are now merged. The version is bumped to 0.7.6.

Thanks,
Christophe.

Quoted 37 lines · Xose Vazquez Perez
Quoted 7 lines · Martin Wilck

Hi Christophe,

thanks for catching up. This series fixes immediate problems with 0.7.5. The first one corresponds to my previously posted "[PATCH v3 2/2] multipathd: start marginal path checker thread lazily", and fixes a crash. The others fix the problens reported by Xose.

Quoted 5 lines

Regards
Martin

Martin Wilck (4):
libmultipath: fix crash on shutdown if io_err thread isn't running

These three:

Quoted 3 lines

multipathd: fix -Wpointer-to-int-cast warning in uxlsnr
multipath: fix clang warning in delegate_to_multipathd
multipath-tools: build: prevent intermediate file deletion

Quoted 10 lines
 Makefile.inc                       | 1 +
 libmultipath/checkers/Makefile     | 2 ++
 libmultipath/foreign/Makefile      | 2 ++
 libmultipath/io_err_stat.c         | 3 +++
 libmultipath/prioritizers/Makefile | 2 ++
 multipath/main.c                   | 2 +-
 multipathd/uxlsnr.c                | 4 ++--
 tests/Makefile                     | 5 ++---
 8 files changed, 15 insertions(+), 6 deletions(-)

Merge them ASAP, thanks.

#7 lore raw

Hi,

Am Samstag, den 10.03.2018, 08:43 +0100 schrieb Christophe Varoqui:

Quoted 2 lines

The fixes and missing patches series are now merged. The version is bumped to 0.7.6.

could you please create a tag for 0.7.6? Or is it not officially released yet?

Cheers,
Michael

#8 lore raw

Done.

I also merged the most of the patchsets in the backlog after the 0.7.6 tag. I'll wait for the "paths classification" patchset request for inclusion before tagging the next release.

Thanks.

Quoted 17 lines · Michael Laß

Hi,

Am Samstag, den 10.03.2018, 08:43 +0100 schrieb Christophe Varoqui:

Quoted 2 lines

The fixes and missing patches series are now merged. The version is bumped to 0.7.6.

could you please create a tag for 0.7.6? Or is it not officially released yet?

Cheers,
Michael

--
dm-devel mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/dm-devel