misc multipath patches
Subsystems (2)
Benjamin Marzinski
maintainercover misc multipath patches
This is another collection of miscellaneous patches. The first one is just a resend. The second is a change to how the rados checker is enable that makes it easier to build packages for multiple architectures (since librados isn't supported on all architectures yet). If people have objections, I can continue to use the existing build option. The third is a change that's necessary to get warning messages for bad config files. Another option would be to just change all the config warning messages to the highest priority. The last two are bugfixes.
Benjamin Marzinski (5):
libmultipath: add comment about resuming
libmultipath: change how RADOS checker is enabled
multipath: set verbosity to default during config
mpath: skip device configs without vendor/product
multipathd: fix "show maps json" crash
Makefile.inc | 13 +++++++++++++ libmultipath/checkers/Makefile | 3 ++- libmultipath/config.c | 7 +++++++ libmultipath/debug.c | 3 ++- libmultipath/devmapper.c | 3 +++ multipathd/cli_handlers.c | 6 ++++-- 6 files changed, 31 insertions(+), 4 deletions(-)
Signature · 1 line
2.7.4
Benjamin Marzinski
maintainerPATCH 1/5 libmultipath: add comment about resuming
The reason for the second resume in my commit "libmultipath: fix suspended devs from failed reloads" is not obvious from the multipath code, so add a comment.
--- libmultipath/devmapper.c | 3 +++ 1 file changed, 3 insertions(+)
libmultipath/devmapper.c +3 -0
@@ -399,6 +399,9 @@ int dm_addmap_reload(struct multipath *mpp, char *params, int flush)if (r)return r; +/* If the resume failed, dm will leave the device suspended, and +* drop the new table, so doing a second resume will try using +* the original table */ if (dm_is_suspended (mpp->alias))dm_simplecmd (DM_DEVICE_RESUME , mpp->alias, !flush,1 , udev_flags,0 );
Signature · 1 line
2.7.4
Benjamin Marzinski
maintainerPATCH 2/5 libmultipath: change how RADOS checker is enabled
In reply to Benjamin MarzinskiInstead of making the user call "make", "make install" and "make clean" with ENABLE_RADOS set correctly, have the makefile check if /usr/include/rados/librados.h exists, just like it checks if specific functions exist in a file.
--- Makefile.inc | 13 +++++++++++++ libmultipath/checkers/Makefile | 3 ++- 2 files changed, 15 insertions(+), 1 deletion(-)
Makefile.inc +13 -0
@@ -109,5 +109,18 @@ check_func = \ echo "$$found" \ ) +# Checker whether a file with name $1 exists +check_file = $(shell \ + if [ -f "$1" ]; then \ + found=1; \ + status="yes"; \ + else \ + found=0; \ + status="no"; \ + fi; \ + echo 1>&2 "Checking if $1 exists ... $$status"; \ + echo "$$found" \ + ) + %.o: %.c $(CC) $(CFLAGS) -c -o $@ $<
libmultipath/checkers/Makefile +2 -1
@@ -14,7 +14,8 @@ LIBS= \ libcheckemc_clariion.so \ libcheckhp_sw.so \ libcheckrdac.so -ifneq ($(ENABLE_RADOS),0) + +ifneq ($(call check_file,/usr/include/rados/librados.h),0) LIBS += libcheckrbd.so endif
Signature · 1 line
2.7.4
Benjamin Marzinski
maintainerPATCH 3/5 multipath: set verbosity to default during config
In reply to Benjamin Marzinskicondlog was setting the verbosity to 0 if there was no configuration. This keeps multipath from printing warning messages about config file problems that are found while loading the configuration. Instead, it should use the default config level until it loads the configuration to find the current value.
--- libmultipath/debug.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
libmultipath/debug.c +2 -1
@@ -11,6 +11,7 @@#include "../third-party/valgrind/drd.h" #include "vector.h" #include "config.h" +#include "defaults.h" void dlog (int sink,int prio,const char * fmt, ...) {
@@ -21,7 +22,7 @@ void dlog (int sink, int prio, const char * fmt, ...)va_start (ap, fmt); conf =get_multipath_config ();ANNOTATE_IGNORE_READS_BEGIN (); - thres = (conf) ? conf->verbosity :0 ; + thres = (conf) ? conf->verbosity :DEFAULT_VERBOSITY ;ANNOTATE_IGNORE_READS_END ();put_multipath_config (conf);
Signature · 1 line
2.7.4
Benjamin Marzinski
maintainerPATCH 4/5 mpath: skip device configs without vendor/product
In reply to Benjamin MarzinskiRight now if multipath.conf includes a device configuration without a vendor or product string, it will automatically be applied to all devices, skipping all other configs entirely. This is clearly wrong. This patch makes sure that user added configs include vendor and product strings
--- libmultipath/config.c | 7 +++++++ 1 file changed, 7 insertions(+)
libmultipath/config.c +7 -0
@@ -451,6 +451,13 @@ restart:break ; j = n; vector_foreach_slot_after(hw, hwe2, j) { +/* drop invalid device configs */ +if (!hwe2->vendor || !hwe2->product) { +condlog (0 ,"device config missing vendor or product parameter" ); +vector_del_slot (hw, j--); +free_hwe (hwe2); +continue ; + }if (hwe_regmatch (hwe1, hwe2))continue ;/* dup */
Signature · 1 line
2.7.4
Benjamin Marzinski
maintainerPATCH 5/5 multipathd: fix "show maps json" crash
In reply to Benjamin MarzinskiIf there are no multipath devices, show_maps_json sets the maximum size of the reply buffer to 0. Having a size of 0 causes the calls to calloc and realloc to behave in ways that the code isn't designed to handle, leading to a double-free crash. Instead, show_maps_json should just use the INITIAL_REPLY_LEN if there are no multipath devices.
--- multipathd/cli_handlers.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
multipathd/cli_handlers.c +4 -2
@@ -162,10 +162,12 @@ show_maps_json (char ** r, int * len, struct vectors * vecs)struct multipath * mpp;char * c;char * reply; -unsigned int maxlen =INITIAL_REPLY_LEN * -PRINT_JSON_MULTIPLIER *VECTOR_SIZE (vecs->mpvec); +unsigned int maxlen =INITIAL_REPLY_LEN ;int again =1 ; +if (VECTOR_SIZE (vecs->mpvec) >0 ) + maxlen *=PRINT_JSON_MULTIPLIER *VECTOR_SIZE (vecs->mpvec); + vector_foreach_slot(vecs->mpvec, mpp, i) {if (update_multipath (vecs, mpp->alias,0 )) {return 1 ;
Signature · 1 line
2.7.4
Quoted 7 lines · Benjamin Marzinski
This is another collection of miscellaneous patches. The first one is just a resend. The second is a change to how the rados checker is enable
that makes it easier to build packages for multiple architectures (since
librados isn't supported on all architectures yet). If people have objections, I can continue to use the existing build option.
Well, we're getting close to having to write configure.ac, or something of the kind :-)
But it's fine with me. ACK from me for this series.
Martin
Signature · 8 lines
Dr. Martin Wilck <[email protected]>, Tel. +49 (0)911 74053 2107 SUSE Linux GmbH, GF: Felix Imendörffer, Jane Smithard, Graham Norton HRB 21284 (AG Nürnberg) -- dm-devel mailing list [email protected] https://www.redhat.com/mailman/listinfo/dm-devel
The set is merged.
Thanks.
Quoted 22 lines · Martin Wilck
Quoted 7 lines · Benjamin Marzinski
This is another collection of miscellaneous patches. The first one is just a resend. The second is a change to how the rados checker is enable
that makes it easier to build packages for multiple architectures (since
librados isn't supported on all architectures yet). If people have objections, I can continue to use the existing build option.Well, we're getting close to having to write configure.ac, or something of the kind :-)
But it's fine with me. ACK from me for this series.
Martin
--
Dr. Martin Wilck <[email protected]>, Tel. +49 (0)911 74053 2107 SUSE Linux GmbH, GF: Felix Imendörffer, Jane Smithard, Graham Norton HRB 21284 (AG Nürnberg)