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
On Thu, Dec 17, 2020 at 12:00:14PM +0100, mwi...@suse.com wrote: > From: Martin Wilck > > 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 > multipathd shutdown code makes sure all the checkers have been freed

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

2020-12-17 Thread Benjamin Marzinski
On Thu, Dec 17, 2020 at 12:00:13PM +0100, mwi...@suse.com wrote: > From: Martin Wilck > > Make sure the global logarea (la) is only allocated and freed > hile holding logq_lock. This avoids invalid memory access. > > This patch makes free_logarea() static. libmultipath.version > is unchanged,

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: Benjamin Marzinski >

Re: [dm-devel] dm-raid: stack limits instead of overwriting them.

2020-12-17 Thread S. Baerwolf
Hi I just saw your posts right now. (After posting my text "[PATCH] dm-raid: set discard_granularity non-zero if possible" yesterday) How about iterating over all meta-devices corresponding to the raid1? Having mixed technology devices (TRIM and nonTRIM) I assume discard should be switched

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

2020-12-17 Thread Benjamin Marzinski
Only rdac arrays support 0xC9 vpd page inquiries. All other arrays will return a failure. Only do the rdac inquiry when detecting array capabilities if the array's path checker is explicitly set to rdac, or the path checker is not set, and the array reports that it supports vpd page 0xC9 in the

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

2020-12-17 Thread Benjamin Marzinski
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. This can cause problems in cases where users have strict timing requirements, and the easiest way to solve these issues is to set eh_deadline. Since it's already

[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
This is a set of unrelated patches, based on top of my previous "add library to check if device is a valid path" patchset. The first two patches add a new config option, eh_deadline, that sets the scsi sysfs value of the same name for scsi path devices. This has been requested by multiple

[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

Re: [dm-devel] [PATCH] multipath-tools: replace hidden tab by space in hwtable

2020-12-17 Thread Martin Wilck
On Thu, 2020-12-17 at 16:49 +0100, Xose Vazquez Perez wrote: > Cc: Martin Wilck > Cc: Benjamin Marzinski > Cc: Christophe Varoqui > Cc: DM-DEVEL ML > Signed-off-by: Xose Vazquez Perez > --- > libmultipath/hwtable.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) Interesting, I have

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

2020-12-17 Thread Benjamin Marzinski
On Thu, Dec 17, 2020 at 11:04:44AM +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 >

[dm-devel] [PATCH] multipath-tools: replace hidden tab by space in hwtable

2020-12-17 Thread Xose Vazquez Perez
Cc: Martin Wilck Cc: Benjamin Marzinski Cc: Christophe Varoqui Cc: DM-DEVEL ML Signed-off-by: Xose Vazquez Perez --- libmultipath/hwtable.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libmultipath/hwtable.c b/libmultipath/hwtable.c index a54cc0a3..921aadc5 100644 ---

[dm-devel] [PATCH 0/7] Various multipath-tools patches

2020-12-17 Thread mwilck
From: Martin Wilck Hi Christophe, hi Ben, here are a few patches that have accumulated while I hadn't fixed my previous series "libmultipath: improve cleanup on exit" The first two are actually related to the log_thread work I did in that series, but they're additional fixes on top and I

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

2020-12-17 Thread mwilck
From: Martin Wilck If the root file system is multipathed, and IO is queued because all paths are failed, multipathd may block trying to access the root FS, and thus be unable to reinstate paths. One file that is frequently accessed is /etc/localtime. Avoid that by printing monotonic timestamps

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

2020-12-17 Thread mwilck
From: Martin Wilck 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 multipathd shutdown code makes sure all the checkers have been freed before freeing the checker_class and calling dlclose() to unload the DSO,

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

2020-12-17 Thread mwilck
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 basically unusable, because udevd had been killed by systemd before processing

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

2020-12-17 Thread mwilck
From: Martin Wilck By adding -Wl,-z,defs, we'll get warnings about unresolved symbols at the linking stage. This way we make sure our plugins (checkers etc.) will use versioned symbols from libmultipath, and incompatible plugins can't be loaded any more. Doing this requires explicitly linking

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

2020-12-17 Thread mwilck
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. Signed-off-by: Martin Wilck --- libmultipath/libmultipath.version | 5 + 1 file changed, 5 insertions(+) diff --git

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

2020-12-17 Thread mwilck
From: Martin Wilck Make sure the global logarea (la) is only allocated and freed hile holding logq_lock. This avoids invalid memory access. This patch makes free_logarea() static. libmultipath.version is unchanged, as free_logarea() wasn't exported anyway. Signed-off-by: Martin Wilck ---

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

2020-12-17 Thread mwilck
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. Signed-off-by: Martin Wilck --- libmultipath/log.c | 34 --

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

2020-12-17 Thread mwilck
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 function was called. This patch fixes both, at the cost of using "static" for the

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

2020-12-17 Thread Martin Wilck
On Wed, 2020-12-16 at 21:34 -0600, Benjamin Marzinski wrote: > On Wed, Dec 16, 2020 at 07:17:01PM +0100, mwi...@suse.com wrote: > > > > > > pp = alloc_path(); > > if (!pp) > > @@ -665,13 +666,17 @@ check_path_valid(const char *name, struct > > config *conf, bool is_uevent) > > if