Re: [dm-devel] [PATCH 08/21] libmultipath (coverity): fix tainted values in alua_rtpg.c

2021-11-29 Thread Benjamin Marzinski
On Fri, Nov 19, 2021 at 12:13:25AM +0100, mwi...@suse.com wrote: > From: Martin Wilck > > Coverity needs tainted values limited by constant expressions. > > Signed-off-by: Martin Wilck > --- > libmultipath/prioritizers/alua_rtpg.c | 13 ++-- > libmultipath/prioritizers/alua_spc3.h | 30

Re: [dm-devel] [PATCH 07/21] libmultipath: use strbuf in parse_vpd_pg83()

2021-11-29 Thread Benjamin Marzinski
On Fri, Nov 19, 2021 at 12:13:24AM +0100, mwi...@suse.com wrote: > From: Martin Wilck > > By using the strbuf API, the code gets more readable, as we need > less output size checks. > > While at it, avoid a possible crash by passing a NULL pointer > to memchr(). > > Signed-off-by: Martin Wilck

Re: [dm-devel] [PATCH 05/21] libmultipath (coverity): improve input checking in parse_vpd_pg83

2021-11-29 Thread Benjamin Marzinski
On Fri, Nov 19, 2021 at 12:13:22AM +0100, mwi...@suse.com wrote: > From: Martin Wilck > > Check offsets and other obvious errors in the VPD83 data. > > The original reason to do this was to fix "tained scalar" > warnings from coverity. But this doesn't suffice for coverity > without using a cons

Re: [dm-devel] [PATCH v3 32/35] multipathd: uxlsnr: use poll loop for sending, too

2021-11-29 Thread Benjamin Marzinski
On Sat, Nov 27, 2021 at 04:19:26PM +0100, mwi...@suse.com wrote: > From: Martin Wilck > > send_packet() may busy-loop. By polling for POLLOUT, we can > avoid that, even if it's very unlikely in practice. > > Signed-off-by: Martin Wilck Reviewed-by: Benjamin Marzins

Re: [dm-devel] [PATCH v2 03/48] libmultipath: add optional wakeup functionality to lock.c

2021-11-29 Thread Benjamin Marzinski
On Wed, Nov 24, 2021 at 10:20:53PM +0100, Martin Wilck wrote: > On Wed, 2021-11-24 at 14:41 -0600, Benjamin Marzinski wrote: > > On Thu, Nov 18, 2021 at 11:57:55PM +0100, mwi...@suse.com wrote: > > > From: Martin Wilck > > > > > > Have struct mutex_l

Re: [dm-devel] [PATCH v2 29/48] multipathd: uxlsnr: merge uxsock_trigger() into state machine

2021-11-29 Thread Benjamin Marzinski
On Fri, Nov 26, 2021 at 03:34:59PM +0100, Martin Wilck wrote: > On Wed, 2021-11-24 at 18:38 -0600, Benjamin Marzinski wrote: > > On Thu, Nov 18, 2021 at 11:58:21PM +0100, mwi...@suse.com wrote: > > > From: Martin Wilck > > > > > > This patch s

Re: [dm-devel] [PATCH v2 30/48] multipathd: uxlsnr: add idle notification

2021-11-24 Thread Benjamin Marzinski
On Thu, Nov 18, 2021 at 11:58:22PM +0100, mwi...@suse.com wrote: > From: Martin Wilck > > The previous patches added the state machine and the timeout handling, > but there was no wakeup mechanism for the uxlsnr for cases where > client connections were waiting for the vecs lock. > > This patch

Re: [dm-devel] [PATCH v2 35/48] multipathd: uxlsnr: use recv() for command length

2021-11-24 Thread Benjamin Marzinski
byte. > Reviewed-by: Benjamin Marzinski > Signed-off-by: Martin Wilck > --- > multipathd/uxlsnr.c | 17 + > 1 file changed, 9 insertions(+), 8 deletions(-) > > diff --git a/multipathd/uxlsnr.c b/multipathd/uxlsnr.c > index 24db377..6355279 100644 > --- a/

Re: [dm-devel] [PATCH v2 33/48] multipathd: uxlsnr: drop client_lock

2021-11-24 Thread Benjamin Marzinski
On Thu, Nov 18, 2021 at 11:58:25PM +0100, mwi...@suse.com wrote: > From: Martin Wilck > > The list of clients is never changed anywhere except in > uxsock_listen(). No need to lock. > > Signed-off-by: Martin Wilck Reviewed-by: Benjamin Marzinski > --- >

Re: [dm-devel] [PATCH v2 32/48] multipathd: uxlsnr: use poll loop for sending, too

2021-11-24 Thread Benjamin Marzinski
ugh from CLT_WORK to CLT_SEND, the client hasn't checked for a POLLOUT revent, so it's possible to block here. I'm not sure that we care. If not Reviewed-by: Benjamin Marzinski > Signed-off-by: Martin Wilck > --- > multipathd/uxlsnr.c | 35 ++

Re: [dm-devel] [PATCH v2 31/48] multipathd: uxlsnr: add timeout handling

2021-11-24 Thread Benjamin Marzinski
() will then cause a timeout > reply to be sent to the client. This is more client-friendly > as the client timing out without receiving a reply. > Reviewed-by: Benjamin Marzinski > Signed-off-by: Martin Wilck > --- > multipathd/uxlsnr.c | 57

Re: [dm-devel] [PATCH v2 29/48] multipathd: uxlsnr: merge uxsock_trigger() into state machine

2021-11-24 Thread Benjamin Marzinski
On Thu, Nov 18, 2021 at 11:58:21PM +0100, mwi...@suse.com wrote: > From: Martin Wilck > > This patch sets up the bulk of the state machine. client_state_machine() > is called in a loop, proceeding from state to state until it needs > to poll for input or wait for a lock, in which case it returns

Re: [dm-devel] [PATCH v2 29/48] multipathd: uxlsnr: merge uxsock_trigger() into state machine

2021-11-24 Thread Benjamin Marzinski
confusion and misleading > error messages. No cli_handler returns negative values. > > Note: with this patch applied, clients may hang and time out if > the handler fails to acquire the vecs lock. This will be fixed in the > follow-up patch "multipathd: uxlsnr: add idle notificati

Re: [dm-devel] [PATCH v2 12/48] multipathd: add and set cli_handlers in a single step

2021-11-24 Thread Benjamin Marzinski
he same handler multiple > times would be a bug which is tested with assert(). > > Signed-off-by: Martin Wilck Reviewed-by: Benjamin Marzinski > --- > multipathd/cli.c | 95 > multipathd/cli.h | 7 ++-- > 2 files changed, 19 inse

Re: [dm-devel] [PATCH v2 07/48] multipathd: improve delayed reconfigure

2021-11-24 Thread Benjamin Marzinski
fter this change, the only caller of set_config_state() is > checkerloop(). Waking up every second just to see that DAEMON_RUNNING > couldn't be set makes no sense. Therefore set_config_state() is > changed to wait "forever", or until shutdown is requested. Unless > multipa

Re: [dm-devel] [PATCH v2 03/48] libmultipath: add optional wakeup functionality to lock.c

2021-11-24 Thread Benjamin Marzinski
that set_wakeup_fn was added in 10.0.0, instead of 9.2.0, which is a version that never actually existed, but I don't think that's going to cause any problems so, Reviewed-by: Benjamin Marzinski > --- > libmultipath/libmultipath.version | 13 +++-- > libmultipath/lock.

Re: [dm-devel] [PATCH] multipathd: avoid unnecessary path read-only reloads

2021-11-23 Thread Benjamin Marzinski
On Tue, Nov 23, 2021 at 11:05:20AM +, Martin Wilck wrote: > Hi Ben, > > some more thoughts about the ro handling. > > On Mon, 2021-11-22 at 20:39 +0100, Martin Wilck wrote: > > On Mon, 2021-11-22 at 11:43 -0600, Benjamin Marzinski wrote: > > > On Mon, Nov 22, 20

Re: [dm-devel] [PATCH] multipathd: avoid unnecessary path read-only reloads

2021-11-22 Thread Benjamin Marzinski
On Mon, Nov 22, 2021 at 04:48:06PM +, Martin Wilck wrote: > On Mon, 2021-11-22 at 09:35 -0600, Benjamin Marzinski wrote: > > On Fri, Nov 19, 2021 at 09:33:39PM +, Martin Wilck wrote: > > > On Thu, 2021-11-18 at 16:47 -0600, Benjamin Marzinski wrote: > > > >

Re: [dm-devel] [PATCH v3 1/3] Fix potential null pointer dereference

2021-11-22 Thread Benjamin Marzinski
On Mon, Nov 22, 2021 at 12:01:52PM +0800, lixiaokeng wrote: > udev_device_* may return NULL, check it. > > Signed-off-by: Lixiaokeng Reviewed-by: Benjamin Marzinski > --- > libmultipath/discovery.c| 8 +--- > libmultipath/foreign/nvme.c | 4 +++- > libmultipa

Re: [dm-devel] [PATCH] multipathd: avoid unnecessary path read-only reloads

2021-11-22 Thread Benjamin Marzinski
On Fri, Nov 19, 2021 at 09:33:39PM +, Martin Wilck wrote: > On Thu, 2021-11-18 at 16:47 -0600, Benjamin Marzinski wrote: > > A mulitpath device can only be reloaded read/write when all paths are > > read/write. Also, whenever a read-only device is rescanned, the scsi > >

[dm-devel] [PATCH] multipathd: avoid unnecessary path read-only reloads

2021-11-18 Thread Benjamin Marzinski
another uevent with DISK_RO=1. These uevents cause pointless reloads when read-only paths are rescanned. To avoid this, check to see if all paths are read/write before changing a multipath device from read-only to read/write. Signed-off-by: Benjamin Marzinski --- libmultipath/libmultipath.version | 5

Re: [dm-devel] [PATCH 5/5] add prflag to path

2021-11-18 Thread Benjamin Marzinski
On Tue, Nov 16, 2021 at 10:01:15PM +0800, lixiaokeng wrote: > The update_map will frequently be called and there will be > unnecessary checks of reseravtion. We add prflag to path > to avoid this. > > The pp->state changes from others to up or ghost, the > mpath_pr_event_handle should be called. T

Re: [dm-devel] [PATCH v3 0/4] Add "reconfigure all" multipath command

2021-11-18 Thread Benjamin Marzinski
On Thu, Nov 18, 2021 at 02:56:15PM +, Martin Wilck wrote: > On Wed, 2021-11-17 at 18:07 -0600, Benjamin Marzinski wrote: > > This patchset is supposed to replace Martin's > > > > multipathd: add "force_reconfigure" option > > > > patch from

Re: [dm-devel] [PATCH 4/5] Match FREE and MALLOC/STRDUP/REALLOC

2021-11-17 Thread Benjamin Marzinski
On Tue, Nov 16, 2021 at 10:00:53PM +0800, lixiaokeng wrote: > In _DEBUG_ mode, MALLOC/STRDUP/REALLOC and FREE will record > the memory usage. Match them. This looks fine, but personally, I'd rather just have all the DEBUG memory code removed. If people want to check memory usage, there's always va

Re: [dm-devel] [PATCH 2/5] remove unnecessary memset

2021-11-17 Thread Benjamin Marzinski
On Tue, Nov 16, 2021 at 09:59:41PM +0800, lixiaokeng wrote: > MALLOC will set memory zero. memset is unnecessary. > Remove it. > > Signed-off-by: Lixiaokeng Reviewed-by: Benjamin Marzinski > --- > libmultipath/log.c | 1 - > multipathd/waiter.c | 1 - > 2 fi

Re: [dm-devel] [PATCH 3/5] remove unnecessary free

2021-11-17 Thread Benjamin Marzinski
On Tue, Nov 16, 2021 at 10:00:09PM +0800, lixiaokeng wrote: > arg will be free by cleanup_charp. FREE(args) > is unnecessary before return. Remove it. > > Signed-off-by: Lixiaokeng Reviewed-by: Benjamin Marzinski > --- > libmultipath/prioritizers/weightedpath.c | 3 +-- &g

[dm-devel] [PATCH v3 4/4] multipathd: add "reconfigure all" command.

2021-11-17 Thread Benjamin Marzinski
With this commit, multipathd no longer defaults to full reconfigures for the "reconfigure" command and the HUP signal. The default is a weak reconfigure. A new command, "reconfigure all", has been added to do a full reconfigure. Signed-off-by: Benjamin Marzinski -

[dm-devel] [PATCH v3 3/4] multipathd: pass in the type of reconfigure

2021-11-17 Thread Benjamin Marzinski
the initial reconfigure, ev_add_map(), and missing_uev_wait_tick() request weak reconfigures. A future patch will enable users to control what kind of reconfigures happen. Signed-off-by: Benjamin Marzinski --- libmultipath/configure.c | 2 +- multipathd/cli_handlers.c | 2 +- multipathd/main.c

[dm-devel] [PATCH v3 2/4] multipathd: remove reconfigure from header file.

2021-11-17 Thread Benjamin Marzinski
Only multipathd/main.c uses it. Signed-off-by: Benjamin Marzinski Reviewed-by: Martin Wilck --- multipathd/main.h | 1 - 1 file changed, 1 deletion(-) diff --git a/multipathd/main.h b/multipathd/main.h index 23ce919e..a1697a74 100644 --- a/multipathd/main.h +++ b/multipathd/main.h @@ -39,7

[dm-devel] [PATCH v3 1/4] multipathd: move delayed_reconfig out of struct config

2021-11-17 Thread Benjamin Marzinski
delayed_reconfig was inside the config struct, but it wasn't updated during an RCU write section, so there's no synchronization on it. Instead, pull it out of the config structure, and use the config_lock to synchronize it. Signed-off-by: Benjamin Marzinski --- libmp

[dm-devel] [PATCH v3 0/4] Add "reconfigure all" multipath command

2021-11-17 Thread Benjamin Marzinski
ggested by Martin Wilck: 0001: update libmultipath.version to handle ABI change in struct config 0003: Clarify commit message Benjamin Marzinski (4): multipathd: move delayed_reconfig out of struct config multipathd: remove reconfigure from header file. multipathd: pass in the type of

Re: [dm-devel] [PATCH v2 0/4] Add "reconfigure all" multipath command

2021-11-17 Thread Benjamin Marzinski
On Wed, Nov 17, 2021 at 08:50:55PM +, Martin Wilck wrote: > On Wed, 2021-11-17 at 14:33 -0600, Benjamin Marzinski wrote: > > > > Changes from v1 as suggested by Martin Wilck: > > > > 0001: update libmultipath.version to handle ABI change in struct > > config

[dm-devel] [PATCH v2 2/9] libmultipath: skip unneeded steps to get path name

2021-11-17 Thread Benjamin Marzinski
The path already must have a udev device at this point, so it just needs to copy the sysname from it. Signed-off-by: Benjamin Marzinski Reviewed-by: Martin Wilck --- libmultipath/structs_vec.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/libmultipath/structs_vec.c b

[dm-devel] [PATCH v2 1/9] multipathd: remove missing paths on startup

2021-11-17 Thread Benjamin Marzinski
ck to where it could be used to reload the device. Multipath devices now remember if they need to be reloaded, and if so, force_reload is set in select_action(). This means that even when configure is called with FORCE_RELOAD_WEAK, these devices will still be reloaded. Signed-off-by: Benjamin Marz

[dm-devel] [PATCH v2 8/9] multipathd: Remove dependency on systemd-udev-settle.service

2021-11-17 Thread Benjamin Marzinski
before starting. Signed-off-by: Benjamin Marzinski Reviewed-by: Martin Wilck --- multipathd/multipathd.service | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/multipathd/multipathd.service b/multipathd/multipathd.service index 0b2ac814..87cb5349 100644 --- a/multipathd

[dm-devel] [PATCH v2 5/9] multipathd: fully initialize paths added by update_pathvec_from_dm

2021-11-17 Thread Benjamin Marzinski
s on these devices, multipathd will finish initializing them, and remove them if necessary. Signed-off-by: Benjamin Marzinski --- libmultipath/structs.h | 6 + libmultipath/structs_vec.c | 5 ++-- multipathd/cli_handlers.c | 35 -- multipathd/main.c | 51 ++

[dm-devel] [PATCH v2 3/9] libmultipath: don't use fallback wwid in update_pathvec_from_dm

2021-11-17 Thread Benjamin Marzinski
When new paths are added in update_pathvec_from_dm(). If they can't get their regular wwid, they shouldn't try the getting the fallback wwid, and should just copy the wwid of the multipath device. Signed-off-by: Benjamin Marzinski Reviewed-by: Martin Wilck --- libmultipath/discove

[dm-devel] [PATCH v2 9/9] libmultipath: add path wildcard "%I" for init state

2021-11-17 Thread Benjamin Marzinski
From: Martin Wilck Enable printing pp->initialized with 'multipathd show paths format "%I"'. This is supposed to go on top of Ben's "multipathd: remove udev settle dependency" series, to simplify checking multipathd's state. Reviewed-by: Benjamin

[dm-devel] [PATCH v2 4/9] libmultipath: always set INIT_REMOVED in set_path_removed

2021-11-17 Thread Benjamin Marzinski
Avoiding this corner case simplifies a future patch Signed-off-by: Benjamin Marzinski Reviewed-by: Martin Wilck --- libmultipath/structs_vec.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/libmultipath/structs_vec.c b/libmultipath/structs_vec.c index d363e7f6..fb26437a

[dm-devel] [PATCH v2 6/9] multipathd: retrigger uevent for partial paths

2021-11-17 Thread Benjamin Marzinski
If a partial path appears and is not fully initialized within 180 seconds, trigger a uevent. If the udev device is not initialized trigger an add event. Otherwise, trigger a change event. Signed-off-by: Benjamin Marzinski --- libmultipath/libmultipath.version | 2 +- libmultipath/structs.h

[dm-devel] [PATCH v2 7/9] multipathd: remove INIT_PARTIAL paths that aren't in a multipath device

2021-11-17 Thread Benjamin Marzinski
The only reason multipath is monitoring an INIT_PARTIAL path is because it was discovered in a multipath device table. If it stops being part of a multipath device before it gets fully initialized, drop it. Signed-off-by: Benjamin Marzinski Reviewed-by: Martin Wilck --- libmultipath

[dm-devel] [PATCH v2 0/9] multipathd: remove udev settle dependency

2021-11-17 Thread Benjamin Marzinski
INIT_PARTIAL for over 3 minutes, trigger a uevent on it. This is kind of a long waiting period, but I want to avoid firing off another uevent in cases where the problem is that udev is in the middle of a uevent storm, and the expected event is delayed. 0009: Repost of Martin's new init stat

Re: [dm-devel] [PATCH v2 0/4] Add "reconfigure all" multipath command

2021-11-17 Thread Benjamin Marzinski
On Wed, Nov 17, 2021 at 08:50:55PM +, Martin Wilck wrote: > On Wed, 2021-11-17 at 14:33 -0600, Benjamin Marzinski wrote: > > > > Changes from v1 as suggested by Martin Wilck: > > > > 0001: update libmultipath.version to handle ABI change in struct > > config

[dm-devel] [PATCH v2 3/4] multipathd: pass in the type of reconfigure

2021-11-17 Thread Benjamin Marzinski
the initial reconfigure, ev_add_map(), and missing_uev_wait_tick() request weak reconfigures. A future patch will enable users to control what kind of reconfigures happen. Signed-off-by: Benjamin Marzinski --- libmultipath/configure.c | 2 +- multipathd/cli_handlers.c | 2 +- multipathd/main.c

[dm-devel] [PATCH v2 4/4] multipathd: add "reconfigure all" command.

2021-11-17 Thread Benjamin Marzinski
With this commit, multipathd no longer defaults to full reconfigures for the "reconfigure" command and the HUP signal. The default is a weak reconfigure. A new command, "reconfigure all", has been added to do a full reconfigure. Signed-off-by: Benjamin Marzinski Revie

[dm-devel] [PATCH v2 1/4] multipathd: move delayed_reconfig out of struct config

2021-11-17 Thread Benjamin Marzinski
delayed_reconfig was inside the config struct, but it wasn't updated during an RCU write section, so there's no synchronization on it. Instead, pull it out of the config structure, and use the config_lock to synchronize it. Signed-off-by: Benjamin Marzinski --- libmp

[dm-devel] [PATCH v2 0/4] Add "reconfigure all" multipath command

2021-11-17 Thread Benjamin Marzinski
ggested by Martin Wilck: 0001: update libmultipath.version to handle ABI change in struct config 0003: Clarify commit message Benjamin Marzinski (4): multipathd: move delayed_reconfig out of struct config multipathd: remove reconfigure from header file. multipathd: pass in the type of

[dm-devel] [PATCH v2 2/4] multipathd: remove reconfigure from header file.

2021-11-17 Thread Benjamin Marzinski
Only multipathd/main.c uses it. Signed-off-by: Benjamin Marzinski Reviewed-by: Martin Wilck --- multipathd/main.h | 1 - 1 file changed, 1 deletion(-) diff --git a/multipathd/main.h b/multipathd/main.h index 23ce919e..a1697a74 100644 --- a/multipathd/main.h +++ b/multipathd/main.h @@ -39,7

Re: [dm-devel] [PATCH 3/3] multipath-tools: support generating compile_commands.json

2021-11-17 Thread Benjamin Marzinski
On Fri, Nov 12, 2021 at 10:05:51PM +0100, mwi...@suse.com wrote: > From: Martin Wilck > > This file is necessary to run clangd as helper for an IDE, e.g. > with emacs lsp-mode. > > Signed-off-by: Martin Wilck Reviewed-by: Benjamin Marzinski > --- > .gitignore

Re: [dm-devel] [PATCH 1/3] multipath-tools: support ABI testing with libabigail

2021-11-17 Thread Benjamin Marzinski
ect and > track library version changes. > > To check for differences, run "make abi" on some branch, rename the > "abi" directory to "reference-abi", checkout a different branch, > and run "make abi-test". > > Signed-off-by: Martin Wi

Re: [dm-devel] [PATCH 2/3] multipath-tools: add github workflow to save and check ABI

2021-11-17 Thread Benjamin Marzinski
". > > Signed-off-by: Martin Wilck Reviewed-by: Benjamin Marzinski > --- > .github/workflows/abi.yaml | 54 ++ > 1 file changed, 54 insertions(+) > create mode 100644 .github/workflows/abi.yaml > > diff --git a/.github/work

Re: [dm-devel] [PATCH 1/5] Fix potential null pointer dereference

2021-11-17 Thread Benjamin Marzinski
On Tue, Nov 16, 2021 at 09:59:14PM +0800, lixiaokeng wrote: > udev_device_* may return NULL, check it. > > Signed-off-by: Lixiaokeng > --- > libmultipath/discovery.c| 8 +--- > libmultipath/foreign/nvme.c | 4 +++- > libmultipath/util.c | 10 +- > 3 files changed, 17 in

Re: [dm-devel] [PATCH 3/4] multipathd: pass in the type of reconfigure

2021-11-15 Thread Benjamin Marzinski
On Mon, Nov 15, 2021 at 04:23:54PM +, Martin Wilck wrote: > On Mon, 2021-09-20 at 18:21 -0500, Benjamin Marzinski wrote: > > This code doesn't actually change how multipathd reconfigures. It still > > does a weak reconfigure at the start, and full reconfigures later. >

Re: [dm-devel] [PATCH 1/4] multipathd: move delayed_reconfig out of struct config

2021-11-15 Thread Benjamin Marzinski
On Mon, Nov 15, 2021 at 04:27:40PM +, Martin Wilck wrote: > On Mon, 2021-11-15 at 17:10 +0100, Martin Wilck wrote: > > On Mon, 2021-09-20 at 18:21 -0500, Benjamin Marzinski wrote: > > > delayed_reconfig was inside the config struct, but it wasn't updated > > >

[dm-devel] [PATCH] libmultipath: don't return error on invalid values

2021-11-11 Thread Benjamin Marzinski
do_set_int and set_uint return 1 for invalid values. This can cause multipath to fail completely, while reading the config. The config handlers should only return a non-zero value if there is an internal error, not if there is just an invalid value. Signed-off-by: Benjamin Marzinski --- Notes

[dm-devel] [PATCH v3 4/9] libmultipath: pass file and line number to keyword handlers

2021-11-11 Thread Benjamin Marzinski
This will make it possible for the keyword handlers to print more useful warning messages. It will be used by future patches. Signed-off-by: Benjamin Marzinski Reviewed-by: Martin Wilck --- libmultipath/dict.c | 143 +- libmultipath/parser.c | 3

[dm-devel] [PATCH v3 3/9] libmultipath: print the correct file when parsing fails

2021-11-11 Thread Benjamin Marzinski
Don't assume that parsing failed on multipath.conf Signed-off-by: Benjamin Marzinski Reviewed-by: Martin Wilck --- libmultipath/parser.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libmultipath/parser.c b/libmultipath/parser.c index ebe1cbd9..d5595fb0 100644

[dm-devel] [PATCH v3 0/9] improving config parsing warnings

2021-11-11 Thread Benjamin Marzinski
_int() is 0, and covert that to the special case. Benjamin Marzinski (9): libmultipath: add section name to invalid keyword output libmultipath: use typedef for keyword handler function libmultipath: print the correct file when parsing fails libmultipath: pass file and line number to

[dm-devel] [PATCH v3 6/9] libmultipath: improve checks for set_str

2021-11-11 Thread Benjamin Marzinski
aracter in file/directory names. This patch adds seperate handlers for these three cases. If a config line is invalid, these handlers retain the existing config string, if any. Signed-off-by: Benjamin Marzinski Reviewed-by: Martin Wilck --- libmultipath/d

[dm-devel] [PATCH v3 2/9] libmultipath: use typedef for keyword handler function

2021-11-11 Thread Benjamin Marzinski
Don't keep writing out the function type. Signed-off-by: Benjamin Marzinski Reviewed-by: Martin Wilck --- libmultipath/parser.c | 6 +++--- libmultipath/parser.h | 15 ++- 2 files changed, 9 insertions(+), 12 deletions(-) diff --git a/libmultipath/parser.c b/libmultipath/par

[dm-devel] [PATCH v3 5/9] libmultipath: make set_int take a range for valid values

2021-11-11 Thread Benjamin Marzinski
If a value outside of the valid range is passed to set_int, it caps the value at appropriate limit, and issues a warning. Signed-off-by: Benjamin Marzinski Reviewed-by: Martin Wilck --- libmultipath/dict.c | 121 +++- 1 file changed, 75 insertions(+), 46

[dm-devel] [PATCH v3 8/9] libmultipath: split set_int to enable reuse

2021-11-11 Thread Benjamin Marzinski
Split the code that does the actual value parsing out of set_int(), into a helper function, do_set_int(), so that it can be used by other handlers. These functions no longer set the config value at all, when they have invalid input. Signed-off-by: Benjamin Marzinski Reviewed-by: Martin Wilck

[dm-devel] [PATCH v3 9/9] libmultipath: cleanup invalid config handling

2021-11-11 Thread Benjamin Marzinski
ff-by: Benjamin Marzinski Reviewed-by: Martin Wilck --- libmultipath/dict.c | 73 +++-- 1 file changed, 51 insertions(+), 22 deletions(-) diff --git a/libmultipath/dict.c b/libmultipath/dict.c index 68647061..c534d703 100644 --- a/libmultipath/dict.c

[dm-devel] [PATCH v3 7/9] libmultipath: deprecate file and directory config options

2021-11-11 Thread Benjamin Marzinski
Having multipath able to select pathnames for the files and directories it needs causes unnecessary maintainer headaches. Mark these as deprecated, but still support them for now. Signed-off-by: Benjamin Marzinski --- libmultipath/dict.c| 19 +++ multipath/multipath.conf

[dm-devel] [PATCH v3 1/9] libmultipath: add section name to invalid keyword output

2021-11-11 Thread Benjamin Marzinski
with a closing brace). This can confuse users. To make this easier to understand, when multipath prints an invalid keyword message, it now also prints the current section name, which can give users a hint that they didn't end the previous section. Signed-off-by: Benjamin Marzinski Reviewed-

Re: [dm-devel] [PATCH v2 7/9] libmultipath: deprecate file and directory config options

2021-11-11 Thread Benjamin Marzinski
On Thu, Nov 11, 2021 at 11:44:44AM +, Martin Wilck wrote: > On Wed, 2021-11-10 at 19:06 -0600, Benjamin Marzinski wrote: > > Having multipath able to select pathnames for the files and > > directories > > it needs causes unnecessary maintainer headaches. Mark these as >

[dm-devel] [PATCH v2 1/9] libmultipath: add section name to invalid keyword output

2021-11-10 Thread Benjamin Marzinski
with a closing brace). This can confuse users. To make this easier to understand, when multipath prints an invalid keyword message, it now also prints the current section name, which can give users a hint that they didn't end the previous section. Signed-off-by: Benjamin Marzinski Reviewed-

[dm-devel] [PATCH v2 2/9] libmultipath: use typedef for keyword handler function

2021-11-10 Thread Benjamin Marzinski
Don't keep writing out the function type. Signed-off-by: Benjamin Marzinski Reviewed-by: Martin Wilck --- libmultipath/parser.c | 6 +++--- libmultipath/parser.h | 15 ++- 2 files changed, 9 insertions(+), 12 deletions(-) diff --git a/libmultipath/parser.c b/libmultipath/par

[dm-devel] [PATCH v2 9/9] libmultipath: cleanup invalid config handling

2021-11-10 Thread Benjamin Marzinski
ff-by: Benjamin Marzinski --- libmultipath/dict.c | 73 +++-- 1 file changed, 51 insertions(+), 22 deletions(-) diff --git a/libmultipath/dict.c b/libmultipath/dict.c index 3212d14c..37347482 100644 --- a/libmultipath/dict.c +++ b/libmultipath/dict.c @@ -199,8 +1

[dm-devel] [PATCH v2 6/9] libmultipath: improve checks for set_str

2021-11-10 Thread Benjamin Marzinski
aracter in file/directory names. This patch adds seperate handlers for these three cases. If a config line is invalid, these handlers retain the existing config string, if any. Signed-off-by: Benjamin Marzinski --- libmultipath/dict.c | 88 +++-- 1 file c

[dm-devel] [PATCH v2 8/9] libmultipath: split set_int to enable reuse

2021-11-10 Thread Benjamin Marzinski
Split the code that does the actual value parsing out of set_int(), into a helper function, do_set_int(), so that it can be used by other handlers. These functions no longer set the config value at all, when they have invalid input. Signed-off-by: Benjamin Marzinski --- libmultipath/dict.c | 92

[dm-devel] [PATCH v2 7/9] libmultipath: deprecate file and directory config options

2021-11-10 Thread Benjamin Marzinski
Having multipath able to select pathnames for the files and directories it needs causes unnecessary maintainer headaches. Mark these as deprecated, but still support them for now. Signed-off-by: Benjamin Marzinski --- libmultipath/dict.c| 40

[dm-devel] [PATCH v2 4/9] libmultipath: pass file and line number to keyword handlers

2021-11-10 Thread Benjamin Marzinski
This will make it possible for the keyword handlers to print more useful warning messages. It will be used by future patches. Signed-off-by: Benjamin Marzinski --- libmultipath/dict.c | 143 +- libmultipath/parser.c | 3 +- libmultipath/parser.h | 2

[dm-devel] [PATCH v2 3/9] libmultipath: print the correct file when parsing fails

2021-11-10 Thread Benjamin Marzinski
Don't assume that parsing failed on multipath.conf Signed-off-by: Benjamin Marzinski Reviewed-by: Martin Wilck --- libmultipath/parser.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libmultipath/parser.c b/libmultipath/parser.c index ebe1cbd9..d5595fb0 100644

[dm-devel] [PATCH v2 5/9] libmultipath: make set_int take a range for valid values

2021-11-10 Thread Benjamin Marzinski
If a value outside of the valid range is passed to set_int, it caps the value at appropriate limit, and issues a warning. Signed-off-by: Benjamin Marzinski --- libmultipath/dict.c | 121 +++- 1 file changed, 75 insertions(+), 46 deletions(-) diff --git a

[dm-devel] [PATCH v2 0/9] improving config parsing warnings

2021-11-10 Thread Benjamin Marzinski
. They are still used for now. 0007: functions that accept "0" as a special input value will now check if the integer gotten by do_set_int() is 0, and covert that to the special case. Benjamin Marzinski (9): libmultipath: add section name to invalid keyword output libmult

Re: [dm-devel] [PATCH 5/7] multipathd: fully initialize paths added by update_pathvec_from_dm

2021-11-08 Thread Benjamin Marzinski
On Mon, Nov 08, 2021 at 04:55:37PM +, Martin Wilck wrote: > On Mon, 2021-11-08 at 10:29 -0600, Benjamin Marzinski wrote: > > On Fri, Nov 05, 2021 at 11:20:01PM +, Martin Wilck wrote: > > > > 1: udev hasn't gotten an event for a device > > > > > &

Re: [dm-devel] [PATCH 5/7] multipathd: fully initialize paths added by update_pathvec_from_dm

2021-11-08 Thread Benjamin Marzinski
On Fri, Nov 05, 2021 at 11:20:01PM +, Martin Wilck wrote: > On Fri, 2021-11-05 at 16:49 -0500, Benjamin Marzinski wrote: > > On Fri, Nov 05, 2021 at 10:55:11AM +, Martin Wilck wrote: > > > Hi Ben, > > > > > > On Thu, 2021-11-04 at 23:10 +0100, Martin

Re: [dm-devel] [PATCH] libmultipath: add path wildcard "%I" for init state

2021-11-05 Thread Benjamin Marzinski
On Fri, Nov 05, 2021 at 12:03:12PM +0100, mwi...@suse.com wrote: > From: Martin Wilck Reviewed-by: Benjamin Marzinski > > Enable printing pp->initialized with 'multipathd show paths format "%I"'. > This is supposed to go on top of Ben's "multipathd:

Re: [dm-devel] [PATCH] multipath: fix exit status of multipath -T

2021-11-05 Thread Benjamin Marzinski
On Fri, Nov 05, 2021 at 12:01:27PM +0100, mwi...@suse.com wrote: > From: Martin Wilck > > We must set the return value in configure(). Reviewed-by: Benjamin Marzinski > --- > multipath/main.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/multipath/main.c b/

Re: [dm-devel] [PATCH 5/7] multipathd: fully initialize paths added by update_pathvec_from_dm

2021-11-05 Thread Benjamin Marzinski
On Fri, Nov 05, 2021 at 10:55:11AM +, Martin Wilck wrote: > Hi Ben, > > On Thu, 2021-11-04 at 23:10 +0100, Martin Wilck wrote: > > On Wed, 2021-10-20 at 14:15 -0500, Benjamin Marzinski wrote: > > > ... > > > > > > > > Multipat

Re: [dm-devel] [PATCH 5/7] multipathd: fully initialize paths added by update_pathvec_from_dm

2021-11-05 Thread Benjamin Marzinski
On Thu, Nov 04, 2021 at 10:10:18PM +, Martin Wilck wrote: > On Wed, 2021-10-20 at 14:15 -0500, Benjamin Marzinski wrote: > > When paths are added by update_pathvec_from_dm(), udev may not have > > initialized them. This means that it's possible that they are > > supp

Re: [dm-devel] [PATCH 0/7] multipathd: remove udev settle dependency

2021-11-05 Thread Benjamin Marzinski
On Thu, Nov 04, 2021 at 10:00:11PM +, Martin Wilck wrote: > On Wed, 2021-10-20 at 14:15 -0500, Benjamin Marzinski wrote: > > So, it turns out that commit 4ef67017 "libmultipath: add > > update_pathvec_from_dm()" already does most of the hard work of making

Re: [dm-devel] [PATCH 8/8] libmultipath: cleanup invalid config handling

2021-11-05 Thread Benjamin Marzinski
On Thu, Nov 04, 2021 at 09:11:34PM +, Martin Wilck wrote: > On Wed, 2021-10-06 at 15:04 -0500, Benjamin Marzinski wrote: > > Add error reporting to the remaining config handlers. If the value is > > invalid, do not change the existing config option's value. > > L

Re: [dm-devel] [PATCH 7/8] libmultipath: split set_int to enable reuse

2021-11-05 Thread Benjamin Marzinski
On Thu, Nov 04, 2021 at 08:54:11PM +, Martin Wilck wrote: > On Wed, 2021-10-06 at 15:04 -0500, Benjamin Marzinski wrote: > > Split the code that does the actual value parsing out of set_int(), > > into > > a helper function, do_set_int(), so that it can be used by othe

Re: [dm-devel] [PATCH 6/8] libmultipath: improve checks for set_str

2021-11-05 Thread Benjamin Marzinski
On Fri, Nov 05, 2021 at 06:59:11AM +, Martin Wilck wrote: > Hi Ben, > > On Thu, 2021-11-04 at 21:34 +0100, Martin Wilck wrote: > > On Wed, 2021-10-06 at 15:04 -0500, Benjamin Marzinski wrote: > > > multipath always requires absolute pathnames, so make sure all file &

Re: [dm-devel] [PATCH 6/8] libmultipath: improve checks for set_str

2021-11-05 Thread Benjamin Marzinski
On Thu, Nov 04, 2021 at 08:34:20PM +, Martin Wilck wrote: > On Wed, 2021-10-06 at 15:04 -0500, Benjamin Marzinski wrote: > > multipath always requires absolute pathnames, so make sure all file > > and > > directory names start with a slash.  Also check that the directorie

Re: [dm-devel] [PATCH 5/8] libmultipath: make set_int take a range for valid values

2021-11-05 Thread Benjamin Marzinski
On Thu, Nov 04, 2021 at 08:34:33PM +, Martin Wilck wrote: > On Wed, 2021-10-06 at 15:04 -0500, Benjamin Marzinski wrote: > > If a value outside of the valid range is passed to set_int, it caps > > the > > value at appropriate limit, and issues a warning. > >

Re: [dm-devel] [PATCH 1/8] libmulitpath: add section name to invalid keyword output

2021-11-05 Thread Benjamin Marzinski
On Thu, Nov 04, 2021 at 08:55:39PM +, Martin Wilck wrote: > On Wed, 2021-10-06 at 15:04 -0500, Benjamin Marzinski wrote: > > If users forget the closing brace for a section in multipath.conf, > > multipath has no way to detect that. When it sees the keyword at the > > star

Re: [dm-devel] [PATCH 4/8] libmultipath: pass file and line number to keyword handlers

2021-11-05 Thread Benjamin Marzinski
On Thu, Nov 04, 2021 at 08:55:02PM +, Martin Wilck wrote: > On Wed, 2021-10-06 at 15:04 -0500, Benjamin Marzinski wrote: > > This will make it possible for the keyword handlers to print more > > useful > > warning messages. It will be used by future patches. > >

[dm-devel] [PATCH 2/7] libmultipath: skip unneeded steps to get path name

2021-10-20 Thread Benjamin Marzinski
The path already must have a udev device at this point, so it just needs to copy the sysname from it. Signed-off-by: Benjamin Marzinski --- libmultipath/structs_vec.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/libmultipath/structs_vec.c b/libmultipath/structs_vec.c

[dm-devel] [PATCH 4/7] libmultipath: always set INIT_REMOVED in set_path_removed

2021-10-20 Thread Benjamin Marzinski
Avoiding this corner case simplifies a future patch Signed-off-by: Benjamin Marzinski --- libmultipath/structs_vec.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/libmultipath/structs_vec.c b/libmultipath/structs_vec.c index d363e7f6..fb26437a 100644 --- a/libmultipath

[dm-devel] [PATCH 1/7] multipathd: remove missing paths on startup

2021-10-20 Thread Benjamin Marzinski
ck to where it could be used to reload the device. Multipath devices now remember if they need to be reloaded, and if so, force_reload is set in select_action(). This means that even when configure is called with FORCE_RELOAD_WEAK, these devices will still be reloaded. Signed-off-by: Benjamin Marz

[dm-devel] [PATCH 0/7] multipathd: remove udev settle dependency

2021-10-20 Thread Benjamin Marzinski
both by rebooting with necessary and unnecessary multipath devices in the initramfs and multipathd.service set to make multipathd start up at various points after the switch root, and by manually sending remove uevents to unintialize some paths, and then starting multipathd to test specific comb

[dm-devel] [PATCH 7/7] multipathd: Remove dependency on systemd-udev-settle.service

2021-10-20 Thread Benjamin Marzinski
before starting. Signed-off-by: Benjamin Marzinski --- multipathd/multipathd.service | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/multipathd/multipathd.service b/multipathd/multipathd.service index 0b2ac814..87cb5349 100644 --- a/multipathd/multipathd.service +++ b/multipathd

[dm-devel] [PATCH 6/7] multipathd: remove INIT_PARTIAL paths that aren't in a multipath device

2021-10-20 Thread Benjamin Marzinski
The only reason multipath is monitoring an INIT_PARTIAL path is because it was discovered in a multipath device table. If it stops being part of a multipath device before it gets fully initialized, drop it. Signed-off-by: Benjamin Marzinski --- libmultipath/structs_vec.c | 22

[dm-devel] [PATCH 5/7] multipathd: fully initialize paths added by update_pathvec_from_dm

2021-10-20 Thread Benjamin Marzinski
s on these devices, multipathd will finish initializing them, and remove them if necessary. Signed-off-by: Benjamin Marzinski --- libmultipath/structs.h | 6 + libmultipath/structs_vec.c | 5 ++-- multipathd/cli_handlers.c | 4 multipathd/main.c | 48 +

[dm-devel] [PATCH 3/7] libmultipath: don't use fallback wwid in update_pathvec_from_dm

2021-10-20 Thread Benjamin Marzinski
When new paths are added in update_pathvec_from_dm(). If they can't get their regular wwid, they shouldn't try the getting the fallback wwid, and should just copy the wwid of the multipath device. Signed-off-by: Benjamin Marzinski --- libmultipath/discovery.c | 7 --- li

[dm-devel] [PATCH 2/8] libmultipath: use typedef for keyword handler function

2021-10-06 Thread Benjamin Marzinski
Don't keep writing out the function type. Signed-off-by: Benjamin Marzinski --- libmultipath/parser.c | 6 +++--- libmultipath/parser.h | 15 ++- 2 files changed, 9 insertions(+), 12 deletions(-) diff --git a/libmultipath/parser.c b/libmultipath/parser.c index 611054f7..ebe

[dm-devel] [PATCH 5/8] libmultipath: make set_int take a range for valid values

2021-10-06 Thread Benjamin Marzinski
If a value outside of the valid range is passed to set_int, it caps the value at appropriate limit, and issues a warning. Signed-off-by: Benjamin Marzinski --- libmultipath/dict.c | 121 +++- 1 file changed, 75 insertions(+), 46 deletions(-) diff --git a

<    1   2   3   4   5   6   7   8   9   10   >