[dm-devel] [PATCH 3/3] multipathd: avoid io_err_stat ABBA deadlock

2021-01-12 Thread Benjamin Marzinski
being deleted from io_err_pathvec, without the index being decremented, causing the loop to skip elements. Also, service_paths() could be cancelled while holding the io_err_pathvec_lock, so it should have a cleanup handler. Signed-off-by: Benjamin Marzinski --- libmultipath/io_err_stat.

[dm-devel] [PATCH 2/3] multipathd: avoid io_err_stat crash during shutdown

2021-01-12 Thread Benjamin Marzinski
it was set. Signed-off-by: Benjamin Marzinski --- libmultipath/io_err_stat.c | 108 +++-- 1 file changed, 44 insertions(+), 64 deletions(-) diff --git a/libmultipath/io_err_stat.c b/libmultipath/io_err_stat.c index 2e48ee81..4c6f7f08 100644 --- a/libmultipath

[dm-devel] [PATCH 0/3] Multipath io_err_stat fixes

2021-01-12 Thread Benjamin Marzinski
I found an ABBA deadlock in the io_err_stat marginal path code, and in the process of fixing it, noticed a potential crash on shutdown. This patchset addresses both of the issues. Benjamin Marzinski (3): libmultipath: make find_err_path_by_dev() static multipathd: avoid io_err_stat crash

[dm-devel] [PATCH 1/3] libmultipath: make find_err_path_by_dev() static

2021-01-12 Thread Benjamin Marzinski
Signed-off-by: Benjamin Marzinski --- libmultipath/io_err_stat.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libmultipath/io_err_stat.c b/libmultipath/io_err_stat.c index 5363049d..2e48ee81 100644 --- a/libmultipath/io_err_stat.c +++ b/libmultipath/io_err_stat.c @@ -88,7

Re: [dm-devel] [PATCH 0/3] multipath-tools: cleanup uevent generation on startup

2021-01-11 Thread Benjamin Marzinski
On Fri, Jan 08, 2021 at 06:00:41PM +0100, mwi...@suse.com wrote: > From: Martin Wilck For the set Reviewed-by: Benjamin Marzinski > > This series undoes several changes I did myself in an attempt to fix > issues with multipath maps incompletely initialized in udev. They a

Re: [dm-devel] multipath-tools: NEW openSUSE github repo

2021-01-11 Thread Benjamin Marzinski
On Mon, Jan 11, 2021 at 03:54:01PM +0100, Martin Wilck wrote: > On Mon, 2021-01-11 at 08:43 +0100, Hannes Reinecke wrote: > > > > > Looks good to me. > > OK. I have renamed the repositories now. The new openSUSE repo is now > reachable as > > https://github.com/openSUSE/multipath-tools > > The

Re: [dm-devel] [PATCH v3] multipathd: fix path checkint not changed when path state changed from delay to failed

2021-01-04 Thread Benjamin Marzinski
Dec 2020 13:59:16 +0800 > Subject: [PATCH] multipathd: fix path checkint not changed when path state > form delay to failed > > Check_path: when path state change back to failed from delay state, should > change > this path's check interval time to the shortest delay to faster pa

[dm-devel] [PATCH 2/2] multipath.conf.5: Improve checker_timeout description

2021-01-04 Thread Benjamin Marzinski
I was asked to explain how checker_timeout works for checkers like directio, that don't issue scsi commands with an explicit timeout. Also, undeprecate the directio checker. Signed-off-by: Benjamin Marzinski --- multipath/multipath.conf.5 | 20 1 file changed, 12 insertions

[dm-devel] [PATCH 1/2] libmultipath: check for null wwid before strcmp

2021-01-04 Thread Benjamin Marzinski
Commit 749aabd0 (libmultipath: ignore multipaths sections without wwid option) removed all mpentries with a NULL wwid, but didn't stop strcmp() from being run on them in merge_mptable(). The result of strcmp() with a NULL parameter is undefined, so fix that. Signed-off-by: Benjamin Marzinski

[dm-devel] [PATCH 0/2] multipath cleanup patches

2021-01-04 Thread Benjamin Marzinski
based on Martin's comments. Benjamin Marzinski (2): libmultipath: check for null wwid before strcmp multipath.conf.5: Improve checker_timeout description libmultipath/config.c | 2 +- multipath/multipath.conf.5 | 20 2 files changed, 13 insertions(+), 9 deletions

Re: [dm-devel] [PATCH 6/6] multipath.conf.5: Improve checker_timeout description

2021-01-04 Thread Benjamin Marzinski
On Fri, Dec 18, 2020 at 11:56:47PM +, Martin Wilck wrote: > On Fri, 2020-12-18 at 17:06 -0600, Benjamin Marzinski wrote: > > I was asked to explain how checker_timeout works for checkers like > > directio, that don't issue scsi commands with an explicit timeout > > > &

Re: [dm-devel] [PATCH 4/6] libmultipath: ignore multipaths sections without wwid option

2021-01-04 Thread Benjamin Marzinski
On Fri, Dec 18, 2020 at 11:30:41PM +, Martin Wilck wrote: > On Fri, 2020-12-18 at 17:06 -0600, Benjamin Marzinski wrote: > > "multipathd show config local" was crashing in find_mp_by_wwid() if > > the multipath configuration included a multipaths section that did

Re: [dm-devel] [PATCH 1/2] multipath-tools tests: unversioned .so for valgrind tests

2020-12-18 Thread Benjamin Marzinski
On Fri, Dec 18, 2020 at 11:27:13PM +0100, mwi...@suse.com wrote: > From: Martin Wilck > > We need to the same thing for valgrind tests as we did in > 448752f ("libmultipath: create separate .so for unit tests"). > Reviewed-by: Benjamin Marzinski > Signed-off-by:

Re: [dm-devel] [PATCH] libmultipath: fix format warning with clang

2020-12-18 Thread Benjamin Marzinski
On Fri, Dec 18, 2020 at 11:37:53PM +0100, mwi...@suse.com wrote: > From: Martin Wilck > Reviewed-by: Benjamin Marzinski > Reported-by: Xose Vazquez Perez > --- > libmultipath/log.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/libmultipath/log.c b/li

Re: [dm-devel] [PATCH 2/2] multipath-tools unit tests: fix memory leaks in mpathvalid tests

2020-12-18 Thread Benjamin Marzinski
On Fri, Dec 18, 2020 at 11:27:14PM +0100, mwi...@suse.com wrote: > From: Martin Wilck > > They break "make valgrind-test". > Reviewed-by: Benjamin Marzinski > Signed-off-by: Martin Wilck > --- > tests/mpathvalid.c | 4 > 1 file changed, 4 ins

[dm-devel] [PATCH 5/6] multipathd: Fix multipathd stopping on shutdown

2020-12-18 Thread Benjamin Marzinski
tipathd.service sets DefaultDependencies=no and includes the Conflits= dependency, but not the Before= one. This can cause multipathd to continue running past when it is supposed to during shutdown. Signed-off-by: Benjamin Marzinski --- multipathd/multipathd.service | 2 +- 1 file changed, 1 inse

[dm-devel] [PATCH 2/6] mpathpersist: update prkeys file on changing registrations

2020-12-18 Thread Benjamin Marzinski
ths that come online will not be able to register, since multipathd is still using the old reservation key. Fix this. Signed-off-by: Benjamin Marzinski --- libmpathpersist/mpath_persist.c | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/libmpathpersist/mpath_persist.c b/libmpathper

[dm-devel] [PATCH 6/6] multipath.conf.5: Improve checker_timeout description

2020-12-18 Thread Benjamin Marzinski
I was asked to explain how checker_timeout works for checkers like directio, that don't issue scsi commands with an explicit timeout Signed-off-by: Benjamin Marzinski --- multipath/multipath.conf.5 | 9 +++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/multipath

[dm-devel] [PATCH 0/6] More misc multipath patches

2020-12-18 Thread Benjamin Marzinski
is just a doc clarification, inspired by customer questions. Benjamin Marzinski (6): mpathpersist: Fix Register and Ignore with 0x00 SARK mpathpersist: update prkeys file on changing registrations libmultipath: warn about missing braces at end of multipath.conf libmultipath: ignore multipaths

[dm-devel] [PATCH 4/6] libmultipath: ignore multipaths sections without wwid option

2020-12-18 Thread Benjamin Marzinski
"multipathd show config local" was crashing in find_mp_by_wwid() if the multipath configuration included a multipaths section that did not set a wwid option. There is no reason to keep a mpentry that didn't set its wwid. Remove it in merge_mptable(). Signed-off-by: Benjamin

[dm-devel] [PATCH 3/6] libmultipath: warn about missing braces at end of multipath.conf

2020-12-18 Thread Benjamin Marzinski
Multipath doesn't warn when multipath.conf is missing closing braces at the end of the file. This has confused people about the correct config file syntax, so add a warning. Signed-off-by: Benjamin Marzinski --- libmultipath/parser.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions

[dm-devel] [PATCH 1/6] mpathpersist: Fix Register and Ignore with 0x00 SARK

2020-12-18 Thread Benjamin Marzinski
in this case. Signed-off-by: Benjamin Marzinski --- libmpathpersist/mpath_persist.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libmpathpersist/mpath_persist.c b/libmpathpersist/mpath_persist.c index 79322e86..41789c46 100644 --- a/libmpathpersist/mpath_persist.c +++ b

Re: [dm-devel] [PATCH 7/7] libmultipath.version: add missing symbol

2020-12-18 Thread Benjamin Marzinski
On Thu, Dec 17, 2020 at 12:00:18PM +0100, mwi...@suse.com wrote: > From: Martin Wilck > > The weightedpath prioritizer uses get_next_string(). I'd overlooked > this before. This was found with the help of the previous patch. > Reviewed-by: Benjamin Marzinski > Signed-of

Re: [dm-devel] [PATCH 6/7] multipath-tools: make sure plugin DSOs use symbol versions

2020-12-18 Thread Benjamin Marzinski
nd incompatible plugins > can't be loaded any more. Doing this requires explicitly linking > the plugins with all libraries they use, in particular libmultipath. > Reviewed-by: Benjamin Marzinski > Signed-off-by: Martin Wilck > --- > Makefile

Re: [dm-devel] [PATCH 5/7] multipath-tools: avoid access to /etc/localtime

2020-12-18 Thread Benjamin Marzinski
paths. One file that is frequently accessed is > /etc/localtime. Avoid that by printing monotonic timestamps instead. > Reviewed-by: Benjamin Marzinski > Signed-off-by: Martin Wilck > --- > libmultipath/debug.c | 14 -- > libmultipath/devmapper.c | 12 ++--

Re: [dm-devel] [PATCH 4/7] libmultipath: force map reload if udev incomplete

2020-12-18 Thread Benjamin Marzinski
ect_reload_action() into > a trivial helper. Instead, we now check for incompletely initialized udev now > before checking any of the other reload criteria. > Reviewed-by: Benjamin Marzinski > Signed-off-by: Martin Wilck > --- > libmultipath/configure.c | 45

Re: [dm-devel] [PATCH 2/7] libmultipath: protect logarea with logq_lock

2020-12-18 Thread Benjamin Marzinski
On Fri, Dec 18, 2020 at 05:24:25PM +0100, Martin Wilck wrote: > On Thu, 2020-12-17 at 18:03 -0600, Benjamin Marzinski wrote: > > On Thu, Dec 17, 2020 at 12:00:13PM +0100, mwi...@suse.com wrote: > > > > > > -void free_logarea (void) > > > +static void free_log

Re: [dm-devel] [PATCH 4/7] libmultipath: force map reload if udev incomplete

2020-12-17 Thread Benjamin Marzinski
On Thu, Dec 17, 2020 at 12:00:15PM +0100, mwi...@suse.com wrote: > From: Martin Wilck > > We've recently observed various cases of incompletely processed uevents > during initrd processing. Typically, this would leave a dm device in > the state it had after the initial "add" uevent, which is

Re: [dm-devel] [PATCH 3/7] libmultipath: prevent DSO unloading with astray checker threads

2020-12-17 Thread Benjamin Marzinski
> Checkers defining this method may create a detached thread with > entrypoint checker_thread_entry(), which will call the DSO's > libcheck_thread and take care of the refcount handling. > > Reported-by: Benjamin Marzinski Reviewed-by: Benjamin Marzinski > Signed-off-by: M

Re: [dm-devel] [PATCH 2/7] libmultipath: protect logarea with logq_lock

2020-12-17 Thread Benjamin Marzinski
a can only be freed by log_close(), which is called when mulitpathd exits, but it would be nice to have la set to NULL it's freed, just to make it obvious that that there can't be double-frees there. However, the code is clearly correct, so Reviewed-by: Benjamin Marzinski > @@ -96,9 +103,14 @@ voi

Re: [dm-devel] [PATCH 1/7] libmultipath: move logq_lock handling to log.c

2020-12-17 Thread Benjamin Marzinski
On Thu, Dec 17, 2020 at 12:00:12PM +0100, mwi...@suse.com wrote: > From: Martin Wilck > > logq_lock protects internal data structures of log.c, and should > be handled there. This patch doesn't change functionality, except > improving cancel-safety somewhat. > Reviewed-by:

[dm-devel] [PATCH v3 5/5] libmultipath: limit reading 0xc9 vpd page

2020-12-17 Thread Benjamin Marzinski
in the Supported VPD Pages (0x00) vpd page. Multipath was doing the check if either the path checker was set to rdac, or no path checker was set. This means that for almost all non-rdac arrays, multipath was issuing a bad inquiry. This was annoying users. Signed-off-by: Benjamin Marzinski

[dm-devel] [PATCH v3 2/5] libmultipath: add eh_deadline multipath.conf parameter

2020-12-17 Thread Benjamin Marzinski
possible to set fast_io_fail_tmo and dev_loss_tmo from multipath.conf, and have multipath take care of setting it correctly for the scsi devices in sysfs, it makes sense to allow users to set eh_deadline here as well. Signed-off-by: Benjamin Marzinski --- libmultipath/config.c | 2

[dm-devel] [PATCH v3 1/5] libmultipath: move fast_io_fail defines to structs.h

2020-12-17 Thread Benjamin Marzinski
Since fast_io_fail is part of the multipath struct, its symbolic values belong in structs.h. Also, make it an instance of a general enum, which will be used again in future patches, and change the set/print functions which use it to use the general enum instead. Signed-off-by: Benjamin Marzinski

[dm-devel] [PATCH v3 3/5] multipathd: remove redundant vector_free() int configure

2020-12-17 Thread Benjamin Marzinski
remove_maps(vecs) already calls vector_free(vecs->mpvec) Signed-off-by: Benjamin Marzinski --- multipathd/main.c | 8 ++-- 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/multipathd/main.c b/multipathd/main.c index b6a5f5b7..2eab4854 100644 --- a/multipathd/main.c ++

[dm-devel] [PATCH v3 0/5] Misc Multipath patches

2020-12-17 Thread Benjamin Marzinski
r checking vpd page 0x00 0005 (was 0004): added checking for vpd page 0xc9 in vpd page 0x00, as suggested by Martin 0006 (was 0005): Added version script update Benjamin Marzinski (5): libmultipath: move fast_io_fail defines to structs.h libmultipath: add eh_deadline mult

[dm-devel] [PATCH v3 4/5] libmultipath: factor out code to get vpd page data

2020-12-17 Thread Benjamin Marzinski
A future patch will reuse the code to get the vpd page data, so factor it out from get_vpd_sgio(). Signed-off-by: Benjamin Marzinski --- libmultipath/discovery.c | 27 +++ 1 file changed, 19 insertions(+), 8 deletions(-) diff --git a/libmultipath/discovery.c b

Re: [dm-devel] [PATCH v4 22/29] multipath: fix leaks in check_path_valid()

2020-12-17 Thread Benjamin Marzinski
e message when pushing to upstream-queue. Reviewed-by: Benjamin Marzinski > Signed-off-by: Martin Wilck > --- > multipath/main.c | 30 -- > 1 file changed, 20 insertions(+), 10 deletions(-) > > diff --git a/multipath/main.c b/multipath/main.c > i

Re: [dm-devel] [PATCH v3 29/29] libmultipath: fix race between log_safe and log_thread_stop()

2020-12-16 Thread Benjamin Marzinski
them, and thus > possibly accessing a destroyed mutex in log_safe(). Furthermore, taking > both the logev_lock and the logq_lock makes sure the logarea isn't freed > while we are writing to it. > Reviewed-by: Benjamin Marzinski > Signed-off-by: Martin Wilck > --- &

Re: [dm-devel] [PATCH v3 25/29] libmultipath: introduce symbolic values for logsink

2020-12-16 Thread Benjamin Marzinski
On Wed, Dec 16, 2020 at 07:17:04PM +0100, mwi...@suse.com wrote: > From: Martin Wilck > Reviewed-by: Benjamin Marzinski > Signed-off-by: Martin Wilck > --- > libmultipath/debug.c | 4 ++-- > libmultipath/debug.h | 6 ++ > libmultipath/devmapper.c | 4 ++-

Re: [dm-devel] [PATCH v3 24/29] libmultipath: use libmp_verbosity to track verbosity

2020-12-16 Thread Benjamin Marzinski
gt; back to the previous value or not after that, depending on whether > command line options or configuration file settings should take > precedence. > > Replace internal access to conf->verbosity with the new variable. > Reviewed-by: Benjamin Marzinski > Signed-off-by: Martin Wil

Re: [dm-devel] [PATCH v3 22/29] multipath: fix leaks in check_path_valid()

2020-12-16 Thread Benjamin Marzinski
On Wed, Dec 16, 2020 at 07:17:01PM +0100, mwi...@suse.com wrote: > From: Martin Wilck > > There were two leaks in check_path_valid(): if path status was > successfully determined before calling store_pathvec(), free_path() > wasn't called. Also, if an error exit occured, neither cleanup >

Re: [dm-devel] [PATCH v3 20/29] multipath: use atexit() for cleanup handlers

2020-12-16 Thread Benjamin Marzinski
On Wed, Dec 16, 2020 at 07:16:59PM +0100, mwi...@suse.com wrote: > From: Martin Wilck > > Signed-off-by: Martin Wilck Reviewed-by: Benjamin Marzinski > --- > multipath/main.c | 37 - > 1 file changed, 16 insertions(+), 21 deletions(

Re: [dm-devel] [PATCH v3 18/29] libmultipath: fix log_thread startup and teardown

2020-12-16 Thread Benjamin Marzinski
there's no guarantee that 0 is not a valid > pthread_t value). Sixth, pthread_cancel() was called under logq_lock, which > doesn't make sense to me. > Reviewed-by: Benjamin Marzinski > Signed-off-by: Martin Wilck > --- > libmultipath/log_pthread.c | 62 +++--

Re: [dm-devel] [PATCH v3 02/29] multipathd: Fix liburcu memory leak

2020-12-16 Thread Benjamin Marzinski
cu's default RCU call handler, > which liburcu refuses to stop/join. See comments in the code. > Reviewed-by: Benjamin Marzinski > Signed-off-by: Martin Wilck > --- > multipathd/main.c | 45 - > 1 file changed, 44 insertions(+), 1 de

Re: [dm-devel] [PATCH v2 5/6] libmultipath: limit reading 0xc9 vpd page

2020-12-16 Thread Benjamin Marzinski
On Wed, Dec 16, 2020 at 09:18:01PM +, Martin Wilck wrote: > On Wed, 2020-11-04 at 00:54 -0600, Benjamin Marzinski wrote: > > Only rdac arrays support 0xC9 vpd page inquiries. All other arrays > > will > > return a failure. Only do the rdac inquiry when detecting a

Re: [dm-devel] [PATCH v2 4/6] libmultipath: factor out code to get vpd page data

2020-12-16 Thread Benjamin Marzinski
On Wed, Dec 16, 2020 at 09:13:49PM +, Martin Wilck wrote: > On Wed, 2020-11-04 at 00:54 -0600, Benjamin Marzinski wrote: > > A future patch will reuse the code to get the vpd page data, so > > factor > > it out from get_vpd_sgio(). > > > >

Re: [dm-devel] [PATCH v2 22/29] multipath: fix leaks in check_path_valid()

2020-12-16 Thread Benjamin Marzinski
it will automatically get freed by the system anyway. -Ben > > One day we should remove the exit() calls somewhere deep down in our > libraries, and deal with the respective errors cleanly. > > @lixiaokeng, I hope this is ok for you, as you brought the issue up > originally (

Re: [dm-devel] [PATCH v2 1/5] multipath: fix issues found by compiling with gcc 10

2020-12-03 Thread Benjamin Marzinski
On Wed, Dec 02, 2020 at 01:54:57PM +, Martin Wilck wrote: > Hi Ben, > > On Wed, 2020-02-19 at 14:21 -0600, Benjamin Marzinski wrote: > > Signed-off-by: Benjamin Marzinski > > --- > > kpartx/dasd.c| 6 +++--- > > libmultipath/print.c | 16 +

Re: [dm-devel] [RFC PATCH] libmultipath: prevent DSO unloading with astray checker threads

2020-11-24 Thread Benjamin Marzinski
On Fri, Nov 06, 2020 at 06:32:16PM +0100, Martin Wilck wrote: > On Thu, 2020-11-05 at 18:41 -0600, Benjamin Marzinski wrote: > > > > I can't make this segfault. So that looks good, but it does need > > libmultipath.version updated to include checker_thread_entry() > &g

Re: [dm-devel] [PATCH] mpathpersist: Fix Register and Ignore with 0x00 SARK

2020-11-23 Thread Benjamin Marzinski
On Mon, Nov 09, 2020 at 05:12:42PM -0600, Benjamin Marzinski wrote: > When the Register and Ignore command is run with sg_persist, if a 0x00 > Service Action Reservation Key is given or the --param-sark option is > not used at all, sg_persist will clear the registration. mpathpersist &g

[dm-devel] [PATCH] mpathpersist: Fix Register and Ignore with 0x00 SARK

2020-11-09 Thread Benjamin Marzinski
in this case. Signed-off-by: Benjamin Marzinski --- libmpathpersist/mpath_persist.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libmpathpersist/mpath_persist.c b/libmpathpersist/mpath_persist.c index 79322e86..703f8e13 100644 --- a/libmpathpersist/mpath_persist.c +++ b

Re: [dm-devel] [PATCH v4] libmultipath: fix memory leaks in coalesce_paths

2020-11-09 Thread Benjamin Marzinski
f newmp need not > be copied to mpvec, we free newmp at the end of the func. > Reviewed-by: Benjamin Marzinski > Signed-off-by: Lixiaokeng > Signed-off-by: Zhiqiang Liu > Signed-off-by: Linfeilong > --- > libmultipath/configure.c | 40 +---

Re: [dm-devel] [RFC PATCH] libmultipath: prevent DSO unloading with astray checker threads

2020-11-05 Thread Benjamin Marzinski
> Checkers defining this method may create a detached thread with > entrypoint checker_thread_entry(), which will call the DSO's > libcheck_thread and take care of the refcount handling. I can't make this segfault. So that looks good, but it does need libmultipath.version updated to include check

Re: [dm-devel] [PATCH 5/5] libmultipath: don't dlclose tur checker DSO

2020-11-04 Thread Benjamin Marzinski
On Wed, Nov 04, 2020 at 11:56:07PM +, Martin Wilck wrote: > On Wed, 2020-11-04 at 17:27 -0600, Benjamin Marzinski wrote: > > On Wed, Nov 04, 2020 at 10:39:39PM +, Martin Wilck wrote: > > > On Mon, 2020-11-02 at 12:27 -0600, Benjamin Marzinski wrote: > > > >

Re: [dm-devel] [PATCH 5/5] libmultipath: don't dlclose tur checker DSO

2020-11-04 Thread Benjamin Marzinski
On Wed, Nov 04, 2020 at 10:39:39PM +, Martin Wilck wrote: > On Mon, 2020-11-02 at 12:27 -0600, Benjamin Marzinski wrote: > > On Fri, Oct 30, 2020 at 09:15:39PM +, Martin Wilck wrote: > > > On Fri, 2020-10-23 at 16:15 -0500, Benjamin Marzinski wrote: > > > &

Re: [dm-devel] Thoughts about multipathd's log thread

2020-11-04 Thread Benjamin Marzinski
On Wed, Nov 04, 2020 at 03:11:04PM +0100, Hannes Reinecke wrote: > On 11/2/20 11:40 PM, Benjamin Marzinski wrote: > >On Mon, Nov 02, 2020 at 01:17:28PM +0100, Martin Wilck wrote: > >>(sending again, with dm-devel on cc. Sorry!) > >> > >>Hi Ben, hi Christophe, &g

Re: [dm-devel] [PATCH v2 29/29] libmultipath: fix race between log_safe and log_thread_stop()

2020-11-04 Thread Benjamin Marzinski
On Wed, Nov 04, 2020 at 01:36:02PM +0100, Martin Wilck wrote: > On Mon, 2020-11-02 at 18:11 -0600, Benjamin Marzinski wrote: > > On Mon, Oct 26, 2020 at 06:24:57PM +0100, Martin Wilck wrote: > > > On Mon, 2020-10-26 at 17:22 +0100, Martin Wilck wrote: > > > > On

[dm-devel] [PATCH v2 2/6] libmultipath: add eh_deadline multipath.conf parameter

2020-11-03 Thread Benjamin Marzinski
possible to set fast_io_fail_tmo and dev_loss_tmo from multipath.conf, and have multipath take care of setting it correctly for the scsi devices in sysfs, it makes sense to allow users to set eh_deadline here as well. Signed-off-by: Benjamin Marzinski --- libmultipath/config.c | 2

[dm-devel] [PATCH v2 3/6] multipathd: remove redundant vector_free() int configure

2020-11-03 Thread Benjamin Marzinski
remove_maps(vecs) already calls vector_free(vecs->mpvec) Reviewed-by: Martin Wilck Signed-off-by: Benjamin Marzinski --- multipathd/main.c | 8 ++-- 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/multipathd/main.c b/multipathd/main.c index 0cf8a264..e114bab7 100

[dm-devel] [PATCH v2 1/6] libmultipath: move fast_io_fail defines to structs.h

2020-11-03 Thread Benjamin Marzinski
-off-by: Benjamin Marzinski --- libmultipath/config.h | 8 libmultipath/dict.c| 30 +++--- libmultipath/dict.h| 2 +- libmultipath/propsel.c | 2 +- libmultipath/structs.h | 17 + 5 files changed, 34 insertions(+), 25 deletions(-) diff

[dm-devel] [PATCH v2 6/6] libmultipath: don't dlclose tur checker DSO

2020-11-03 Thread Benjamin Marzinski
libmultipath will never be reinitialized after it has been uninitialzed, not dlclosing the tur checker DSO once a thread is started has minimal cost (keeping the DSO code around until the program exits, which usually happens right after freeing the checkers). Signed-off-by: Benjamin Marzinski

[dm-devel] [PATCH v2 5/6] libmultipath: limit reading 0xc9 vpd page

2020-11-03 Thread Benjamin Marzinski
-off-by: Benjamin Marzinski --- libmultipath/discovery.c | 25 + libmultipath/discovery.h | 1 + libmultipath/propsel.c | 10 ++ 3 files changed, 32 insertions(+), 4 deletions(-) diff --git a/libmultipath/discovery.c b/libmultipath/discovery.c index 95ddbbbd

[dm-devel] [PATCH v2 0/6] Misc Multipath patches

2020-11-03 Thread Benjamin Marzinski
(was 0005): Added version script update Benjamin Marzinski (6): libmultipath: move fast_io_fail defines to structs.h libmultipath: add eh_deadline multipath.conf parameter multipathd: remove redundant vector_free() int configure libmultipath: factor out code to get vpd page data li

[dm-devel] [PATCH v2 4/6] libmultipath: factor out code to get vpd page data

2020-11-03 Thread Benjamin Marzinski
A future patch will reuse the code to get the vpd page data, so factor it out from get_vpd_sgio(). Signed-off-by: Benjamin Marzinski --- libmultipath/discovery.c | 19 +++ 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/libmultipath/discovery.c b/libmultipath

Re: [dm-devel] [PATCH 5/5] libmultipath: don't dlclose tur checker DSO

2020-11-03 Thread Benjamin Marzinski
On Fri, Oct 30, 2020 at 09:15:39PM +, Martin Wilck wrote: > On Fri, 2020-10-23 at 16:15 -0500, Benjamin Marzinski wrote: > > The multipathd tur checker thread is designed to be able to finish at > > any time, even after the tur checker itself has been freed. The > > mul

Re: [dm-devel] Thoughts about multipathd's log thread

2020-11-03 Thread Benjamin Marzinski
On Tue, Nov 03, 2020 at 09:27:13AM +0100, Martin Wilck wrote: > On Mon, 2020-11-02 at 16:40 -0600, Benjamin Marzinski wrote: > > > > I do believe that syslog is allowed to block the caller, but I agree > > that we've mostly moved on to a systemd world where multipathd is

Re: [dm-devel] [PATCH 4/5] libmultipath: only read 0xc9 vpd page for devices with rdac checker

2020-11-02 Thread Benjamin Marzinski
On Mon, Nov 02, 2020 at 07:11:06PM -0600, Benjamin Marzinski wrote: > On Fri, Oct 30, 2020 at 09:12:46PM +, Martin Wilck wrote: > > On Fri, 2020-10-23 at 16:15 -0500, Benjamin Marzinski wrote: > > > Only rdac arrays support 0xC9 vpd page inquiries. All other arrays >

Re: [dm-devel] [PATCH 2/5] libmultipath: add eh_deadline multipath.conf parameter

2020-11-02 Thread Benjamin Marzinski
On Fri, Oct 30, 2020 at 09:00:48PM +, Martin Wilck wrote: > On Fri, 2020-10-23 at 16:15 -0500, Benjamin Marzinski wrote: > > There are times a fc rport is never lost, meaning that > > fast_io_fail_tmo > > and dev_loss_tmo never trigger, but scsi commands still hang. T

Re: [dm-devel] [PATCH 4/5] libmultipath: only read 0xc9 vpd page for devices with rdac checker

2020-11-02 Thread Benjamin Marzinski
On Fri, Oct 30, 2020 at 09:12:46PM +, Martin Wilck wrote: > On Fri, 2020-10-23 at 16:15 -0500, Benjamin Marzinski wrote: > > Only rdac arrays support 0xC9 vpd page inquiries. All other arrays > > will > > return a failure. Since all rdac arrays in the the built-in dev

Re: [dm-devel] [PATCH v2 29/29] libmultipath: fix race between log_safe and log_thread_stop()

2020-11-02 Thread Benjamin Marzinski
On Mon, Oct 26, 2020 at 06:24:57PM +0100, Martin Wilck wrote: > On Mon, 2020-10-26 at 17:22 +0100, Martin Wilck wrote: > > On Mon, 2020-10-19 at 21:20 -0500, Benjamin Marzinski wrote: > > > On Fri, Oct 16, 2020 at 12:45:01PM +0200, mwi...@suse.com wrote: > >

Re: [dm-devel] Thoughts about multipathd's log thread

2020-11-02 Thread Benjamin Marzinski
On Mon, Nov 02, 2020 at 01:17:28PM +0100, Martin Wilck wrote: > (sending again, with dm-devel on cc. Sorry!) > > Hi Ben, hi Christophe, > > AFAIU, the purpose of the log thread is to avoid blocking while writing > log messages to the syslog socket. The thread has been in place for a > long time.

Re: [dm-devel] [PATCH v3] libmultipath: fix memory leaks in coalesce_paths

2020-11-02 Thread Benjamin Marzinski
On Mon, Nov 02, 2020 at 10:41:22AM +0800, lixiaokeng wrote: > When multipath -F are executed first and multipath -v2 or > -d are executed later, asan will warn memory leaks. The > reason is that the mpp allocated in coalesce_paths isn't > freed. Here we use newmp to store mpp. If mpvec is NULL, >

Re: [dm-devel] [PATCH v3 0/4] add library to check if device is a valid path

2020-11-02 Thread Benjamin Marzinski
On Sun, Nov 01, 2020 at 09:33:09PM +, Martin Wilck wrote: > On Wed, 2020-10-21 at 16:39 -0500, Benjamin Marzinski wrote: > > The main part of the this patchset is the first patch, which adds a > > new library interface to check whether devices are valid paths. This > >

Re: [dm-devel] [PATCH 0/5] Fixes for musl libc / alpine

2020-11-02 Thread Benjamin Marzinski
On Tue, Oct 27, 2020 at 11:45:31PM +0100, mwi...@suse.com wrote: > From: Martin Wilck Reviewed-by: Benjamin Marzinski for the set. > > Hi Christophe, Ben, all, > > this series of patches fixes the compilation and unit-test > problems of latest upstream with musl libc. >

Re: [dm-devel] [PATCH 4/5] libmultipath tests: fix strerror() difference between musl and glibc

2020-11-02 Thread Benjamin Marzinski
On Tue, Oct 27, 2020 at 11:45:35PM +0100, mwi...@suse.com wrote: > From: Martin Wilck > > If an error occurs with errno=0, strerror() on musl returns a different > string than "Success". Make sure the test doesn't fail for that reason. > > Signed-off-by: Martin Wilck > --- > tests/alias.c

Re: [dm-devel] [PATCH 5/5] libmultipath: don't dlclose tur checker DSO

2020-11-02 Thread Benjamin Marzinski
On Fri, Oct 30, 2020 at 09:15:39PM +, Martin Wilck wrote: > On Fri, 2020-10-23 at 16:15 -0500, Benjamin Marzinski wrote: > > The multipathd tur checker thread is designed to be able to finish at > > any time, even after the tur checker itself has been freed. The > > mul

[dm-devel] [PATCH 4/5] libmultipath: only read 0xc9 vpd page for devices with rdac checker

2020-10-23 Thread Benjamin Marzinski
. Cc: Steve Schremmer Cc: NetApp RDAC team Signed-off-by: Benjamin Marzinski --- libmultipath/propsel.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libmultipath/propsel.c b/libmultipath/propsel.c index fa4ac5d9..90a77d77 100644 --- a/libmultipath/propsel.c +++ b

[dm-devel] [PATCH 3/5] multipathd: remove redundant vector_free() int configure

2020-10-23 Thread Benjamin Marzinski
remove_maps(vecs) already calls vector_free(vecs->mpvec) Signed-off-by: Benjamin Marzinski --- multipathd/main.c | 8 ++-- 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/multipathd/main.c b/multipathd/main.c index 0cf8a264..e114bab7 100644 --- a/multipathd/main.c ++

[dm-devel] [PATCH 5/5] libmultipath: don't dlclose tur checker DSO

2020-10-23 Thread Benjamin Marzinski
libmultipath will never be reinitialized after it has been uninitialzed, not dlclosing the tur checker DSO once a thread is started has minimal cost (keeping the DSO code around until the program exits, which usually happens right after freeing the checkers). Signed-off-by: Benjamin Marzinski

[dm-devel] [PATCH 0/5] Misc Multipath patches

2020-10-23 Thread Benjamin Marzinski
hould work. Benjamin Marzinski (5): libmultipath: move fast_io_fail defines to structs.h libmultipath: add eh_deadline multipath.conf parameter multipathd: remove redundant vector_free() int configure libmultipath: only read 0xc9 vpd page for devices with rdac checker libmultipath: don't d

[dm-devel] [PATCH 1/5] libmultipath: move fast_io_fail defines to structs.h

2020-10-23 Thread Benjamin Marzinski
Since fast_io_fail is part of the multipath struct, its symbolic values belong in structs.h. Also, make it an instance of a general enum, which will be used again in future patches, and change the set/print functions which use it to use the general enum instead. Signed-off-by: Benjamin Marzinski

[dm-devel] [PATCH v3 4/4] libmultipath: change log level for null uid_attribute

2020-10-21 Thread Benjamin Marzinski
If uid_attribute is explicitly set to an empty string, multipath should log the uid at the default log level, since using the fallback code is the expected behavior. Signed-off-by: Benjamin Marzinski --- libmultipath/discovery.c | 8 ++-- 1 file changed, 6 insertions(+), 2 deletions

[dm-devel] [PATCH v3 1/4] multipath: add libmpathvalid library

2020-10-21 Thread Benjamin Marzinski
the existing paths to see if another has the same wwid, it expects the caller to pass in an array of the already known path wwids, and checks if the current path matches any of those. The library also doesn't set up the device-mapper library. It leaves this up to the caller. Signed-off-by: Benjamin

[dm-devel] [PATCH v3 0/4] add library to check if device is a valid path

2020-10-21 Thread Benjamin Marzinski
ew 0004: was 0003. Untangled the logic, at Martin's suggestion. Benjamin Marzinski (4): multipath: add libmpathvalid library multipath-tools tests: and unit tests for libmpathvalid libmultipath: add uid failback for dasd devices libmultipath: change log level for

Re: [dm-devel] [PATCH v2 01/29] multipathd: uxlsnr: avoid deadlock on exit

2020-10-20 Thread Benjamin Marzinski
ver, client_lock is not a "struct lock", but a plain > pthread_mutex_t. > > Fixes: 3d611a2 ("multipathd: cancel threads early during shutdown") Oops. Forgot to send this one. Reviewed-by: Benjamin Marzinski > Signed-off-by: Martin Wilck > --- > multipathd/

Re: [dm-devel] [PATCH v2 29/29] libmultipath: fix race between log_safe and log_thread_stop()

2020-10-19 Thread Benjamin Marzinski
On Fri, Oct 16, 2020 at 12:45:01PM +0200, mwi...@suse.com wrote: > From: Martin Wilck > > log_safe() could race with log_thread_stop(); simply > checking the value of log_thr has never been safe. By converting the > mutexes to static initializers, we avoid having to destroy them, and thus >

Re: [dm-devel] [PATCH v2 28/29] multipathd: sanitize uxsock_listen()

2020-10-19 Thread Benjamin Marzinski
ient connections */ > +#define POLLFDS_BASE 2 > +#define POLLFD_CHUNK (4096 / sizeof(struct pollfd)) > +/* Minimum mumber of pollfds to reserve for clients */ > +#define MIN_POLLS (POLLFD_CHUNK - POLLFDS_BASE) Reviewed-by: Benjamin Marzinski I have one nitpick. This code looks like it'

Re: [dm-devel] [PATCH v2 27/29] multipathd: common code for "-k" and command args

2020-10-19 Thread Benjamin Marzinski
"%s ", argv[optind]); > + optind++; > + } > + c += snprintf(c, s + CMDSIZE - c, "\n"); combining these two methods makes is obvious that adding the newline t

Re: [dm-devel] [PATCH v2 26/29] libmultipath: simplify dlog()

2020-10-19 Thread Benjamin Marzinski
optimize > away log messages with higher loglevel. > Reviewed-by: Benjamin Marzinski > Signed-off-by: Martin Wilck > --- > libmultipath/debug.c | 30 +- > libmultipath/debug.h | 19 +++ > libmultipath/devmapper.c | 4 +

Re: [dm-devel] [PATCH v2 24/29] libmultipath: use libmp_verbosity to track verbosity

2020-10-19 Thread Benjamin Marzinski
On Fri, Oct 16, 2020 at 12:44:56PM +0200, mwi...@suse.com wrote: > From: Martin Wilck > > Introduce a new global variable to set the verbosity of libmultipath. > This avoids accessing the configuration in every dlog() call. > When libmultipath reads its configuration in init_config() or >

Re: [dm-devel] [PATCH v2 23/29] multipath-tools: mpath-tools.supp: file with valgrind suppressions

2020-10-19 Thread Benjamin Marzinski
ools.supp \ > --leak-check=full --show-leak-kinds=all $COMMAND > Reviewed-by: Benjamin Marzinski > Signed-off-by: Martin Wilck > --- > third-party/valgrind/mpath-tools.supp | 32 +++ > 1 file changed, 32 insertions(+) > create mode 100644 th

Re: [dm-devel] [PATCH v2 18/29] libmultipath: fix log_thread startup and teardown

2020-10-19 Thread Benjamin Marzinski
On Fri, Oct 16, 2020 at 12:44:50PM +0200, mwi...@suse.com wrote: > From: Martin Wilck > > This fixes several issues with the log_thread. First, the running > flag logq_running should be set by the thread itself, not by > log_thread_start()/_stop(). Second, the thread was both cancelled and >

Re: [dm-devel] [PATCH v2 14/29] libmultipath: add libmp_dm_exit()

2020-10-19 Thread Benjamin Marzinski
> libdm active. > Reviewed-by: Benjamin Marzinski > Signed-off-by: Martin Wilck > --- > libmultipath/config.c| 1 + > libmultipath/config.h| 2 ++ > libmultipath/devmapper.c | 15 +++ > libmultipath/devmapper.h | 1 + > 4 files changed, 19 in

Re: [dm-devel] [PATCH v2 07/29] multipathd: move conf destruction into separate function

2020-10-19 Thread Benjamin Marzinski
le. > Reviewed-by: Benjamin Marzinski > Signed-off-by: Martin Wilck > --- > multipathd/main.c | 20 +++- > 1 file changed, 11 insertions(+), 9 deletions(-) > > diff --git a/multipathd/main.c b/multipathd/main.c > index 8b9df55..722ef69 100644 > --- a/m

Re: [dm-devel] [PATCH v3 17/21] libmultipath: add udev and logsink symbols

2020-10-19 Thread Benjamin Marzinski
ltipath's internal ones. In this case, calling > libmultipath_init() can be skipped, but like before, > udev should be initialized (using udev_new()) before making any > libmultipath calls. > Reviewed-by: Benjamin Marzinski > Signed-off-by: Martin Wilck > --- > libm

Re: [dm-devel] [PATCH v3 11/21] libmultipath: protect racy libdevmapper calls with a mutex

2020-10-19 Thread Benjamin Marzinski
e. > > Cc: lixiaok...@huawei.com Reviewed-by: Benjamin Marzinski > Signed-off-by: Martin Wilck > --- > libmultipath/devmapper.c | 73 +++ > libmultipath/devmapper.h | 2 + > libmultipath/libmultipath.version | 6 +++ > libmulti

Re: [dm-devel] [PATCH v3 10/21] libmultipath: devmapper: refactor libdm version determination

2020-10-16 Thread Benjamin Marzinski
;version field, which isn't needed any more after this > change. This makes it necessary to fixup the hwtable test. Also, it > represents an incompatible ABI change as offsets in "struct config" are > changed, and two symbols removed. Bump the ABI major version to

Re: [dm-devel] [PATCH v2 12/12] libmpathpersist: initialize mpp->hwe in get_mpvec()

2020-10-16 Thread Benjamin Marzinski
On Fri, Oct 16, 2020 at 12:42:39PM +0200, mwi...@suse.com wrote: > From: Martin Wilck Reviewed-by: Benjamin Marzinski > > In __mpath_persistent_reserve_out, we call select_all_tg_pt(), > which requires mpp->hwe to be set. Initialize it in get_mpvec(). > > Fixes: 5b54e7

Re: [dm-devel] [PATCH v2 08/12] libmultipath: create separate .so for unit tests

2020-10-16 Thread Benjamin Marzinski
can work around > that by simply using a non-versioned library for the unit tests. > Therefore we add a seperate rule here. Do this before actually > adding a version script, to avoid breakage during bisection. > Reviewed-by: Benjamin Marzinski > Signed-off-by: Martin Wilck >

<    3   4   5   6   7   8   9   10   11   12   >