[dm-devel] [PATCH v2 3/3] libmultipath: invert regexes that start with exclamation point

2020-06-09 Thread Benjamin Marzinski
to the blacklist unit tests to verify the inverse matching code and the new default blacklist. Signed-off-by: Benjamin Marzinski --- libmultipath/blacklist.c | 41 +- libmultipath/blacklist.h | 3 + multipath/multipath.conf.5 | 17 -- tests/blacklist.c | 110 +

Re: [dm-devel] [PATCH 0/2] multipath-tools: disable foreign libraries by default

2020-06-09 Thread Benjamin Marzinski
l > > This patch set implements this idea. > Reviewed-by: Benjamin Marzinski For the set. > Regards, > Martin > > > Martin Wilck (2): > libmultipath: set "enable_foreign" to NONE by default > multipath: add "-e" option

Re: [dm-devel] [RFC PATCH 0/2] multipath: change default devnode blacklist

2020-06-08 Thread Benjamin Marzinski
On Sat, Jun 06, 2020 at 07:23:28PM +, Martin Wilck wrote: > On Fri, 2020-06-05 at 17:27 -0500, Benjamin Marzinski wrote: > > On Fri, Jun 05, 2020 at 07:20:26PM +, Martin Wilck wrote: > > > Hi Ben, > > > > > > On Thu, 2020-06-04 at 19:30 -0500, Benjamin

Re: [dm-devel] [RFC PATCH 0/2] multipath: change default devnode blacklist

2020-06-05 Thread Benjamin Marzinski
On Fri, Jun 05, 2020 at 07:20:26PM +, Martin Wilck wrote: > Hi Ben, > > On Thu, 2020-06-04 at 19:30 -0500, Benjamin Marzinski wrote: > > I recently got a request to add the Oracle ASM filer driver devices > > to > > multipath's builtin devnode blacklist. However,

[dm-devel] [RFC PATCH 1/2] libmultipath: change filter_devnode arguments

2020-06-05 Thread Benjamin Marzinski
Instead of taking the blist and elist devnode vectors, filter device now takes a config struct. This change is necessary to enable future commits. It makes no functional changes to the code. Signed-off-by: Benjamin Marzinski --- libmultipath/blacklist.c | 8 libmultipath/blacklist.h

[dm-devel] [PATCH] libmultipath: fix condlog NULL argument in uevent_get_env_var

2020-06-05 Thread Benjamin Marzinski
.c:132:25: note: format string is defined here 132 | condlog(4, "%s: %s -> '%s'", __func__, attr, p); | ^~ If p is NULL, use "(null)" instead. Signed-off-by: Benjamin Marzinski --- libmultipath/uevent.c | 2 +- 1 file changed, 1 insertio

[dm-devel] [RFC PATCH 2/2] libmultipath: change how default devnode blacklist works

2020-06-05 Thread Benjamin Marzinski
it with "multipathd show config" or "multipath -t", since those are expected to print a valid condig. It is displayed in the "multipathd show blacklist" output, however. The blacklist unit tests have also been updated to deal with the changes. Signed-off-by: Benjam

[dm-devel] [RFC PATCH 0/2] multipath: change default devnode blacklist

2020-06-05 Thread Benjamin Marzinski
the multipath udev rules already do. If people don't like this solution, the alternative is to add another line to the default devnode blacklist like "^(asm/|oracleafd/|ofsctl)". Benjamin Marzinski (2): libmultipath: change filter_devnode arguments libmultipath: change how default devnode

Re: [dm-devel] [PATCH] 11-dm-mpath.rules: Fix udev rule processing during coldplug

2020-06-02 Thread Benjamin Marzinski
s were created during initrd processing, > but udev processing for the change events of these maps didn't > complete because udevd was killed to switch root. So, in the coldplug > case, play safe and process the rules once more. > > Signed-off-by: Martin Wilck Reviewed-by: Benjamin

Re: [dm-devel] [PATCH 1/1] libdmmp: Add support for upcoming json-c 0.14.0.

2020-05-29 Thread Benjamin Marzinski
On Fri, May 29, 2020 at 09:12:30AM +, Martin Wilck wrote: > Hi Ben, > > On Thu, 2020-05-28 at 23:10 -0500, Benjamin Marzinski wrote: > > From: Björn Esser > > > > TRUE/FALSE are not defined anymore. 1 and 0 are used instead. > > This is backwards compatib

[dm-devel] [PATCH 0/1] multipath: libdmmp json fix

2020-05-28 Thread Benjamin Marzinski
This is a patch I got to keep libdmmp working with the latest json-c release. Björn Esser (1): libdmmp: Add support for upcoming json-c 0.14.0. libdmmp/libdmmp_private.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.17.2 -- dm-devel mailing list dm-devel@redhat.com

[dm-devel] [PATCH 1/1] libdmmp: Add support for upcoming json-c 0.14.0.

2020-05-28 Thread Benjamin Marzinski
From: Björn Esser TRUE/FALSE are not defined anymore. 1 and 0 are used instead. This is backwards compatible, as earlier versions of json-c are using the same integer values in their present definitions. Signed-off-by: Benjamin Marzinski --- libdmmp/libdmmp_private.h | 2 +- 1 file changed

[dm-devel] [PATCH v3 5/6] libmultipath: simplify failed wwid code

2020-05-19 Thread Benjamin Marzinski
the locking work (which made it necessary to write a file, even just to check if a file existed), simply check for files with lstat(), create them with open(), and remove them with unlink(). Reviewed-by: Martin Wilck Signed-off-by: Benjamin Marzinski --- libmultipath/wwids.c | 131

[dm-devel] [PATCH v3 3/6] multipath: centralize validation code

2020-05-19 Thread Benjamin Marzinski
. This code will give almost the same answer as the existing code, with the exception that now, if a device is currently multipathed, it will always be a valid multipath path. Reviewed-by: Martin Wilck Signed-off-by: Benjamin Marzinski --- libmultipath/Makefile| 2 +- libmultipath

[dm-devel] [PATCH v3 2/6] libmultipath: make sysfs_is_multipathed able to return wwid

2020-05-19 Thread Benjamin Marzinski
sysfs_is_multipathed reads the wwid of the dm device holding a path to check if its a multipath device. Add code to optinally set pp->wwid to that wwid. This will be used by a future patch. Reviewed-by: Martin Wilck Signed-off-by: Benjamin Marzinski --- libmultipath/sysfs.c |

[dm-devel] [PATCH v3 6/6] libmultipath: use atomic linkat() in mark_failed_wwid()

2020-05-19 Thread Benjamin Marzinski
-off-by: Benjamin Marzinski --- libmultipath/wwids.c | 42 +- 1 file changed, 29 insertions(+), 13 deletions(-) diff --git a/libmultipath/wwids.c b/libmultipath/wwids.c index aab5da8a..61d9c39e 100644 --- a/libmultipath/wwids.c +++ b/libmultipath/wwids.c

[dm-devel] [PATCH v3 1/6] libmultipath: make libmp_dm_init optional

2020-05-19 Thread Benjamin Marzinski
. Also make dm_prereq a global function. Reviewed-by: Martin Wilck Signed-off-by: Benjamin Marzinski --- libmultipath/devmapper.c | 17 + libmultipath/devmapper.h | 3 ++- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/libmultipath/devmapper.c b/libmultipath

[dm-devel] [PATCH v3 0/6] multipath: path validation library prep work

2020-05-19 Thread Benjamin Marzinski
thd code in various ways, instead of skipping it, as suggested by Martin Wilck Changes from v2: rebased patches on top of Martin's previous patch sets Benjamin Marzinski (5): libmultipath: make libmp_dm_init optional libmultipath: make sysfs_is_multipathed able to return wwid multipath: ce

[dm-devel] [PATCH v3 4/6] Unit tests for is_path_valid()

2020-05-19 Thread Benjamin Marzinski
Reviewed-by: Martin Wilck Signed-off-by: Benjamin Marzinski --- tests/Makefile | 4 +- tests/valid.c | 486 + 2 files changed, 489 insertions(+), 1 deletion(-) create mode 100644 tests/valid.c diff --git a/tests/Makefile b/tests/Makefile

Re: [dm-devel] [PATCH v2 0/6] multipath: path validation library prep work

2020-05-19 Thread Benjamin Marzinski
On Tue, May 19, 2020 at 02:55:05PM +0200, Martin Wilck wrote: > On Mon, 2020-05-18 at 23:57 -0500, Benjamin Marzinski wrote: > > I've been playing around with the SID code more and I've decided to > > hold > > off on submitting the library until I have it working with the SID

[dm-devel] [PATCH v2 0/6] multipath: path validation library prep work

2020-05-18 Thread Benjamin Marzinski
thd code in various ways, instead of skipping it, as suggested by Martin Wilck Benjamin Marzinski (5): libmultipath: make libmp_dm_init optional libmultipath: make sysfs_is_multipathed able to return wwid multipath: centralize validation code Unit tests for is_path_valid() libmultipath: s

[dm-devel] [PATCH v2 2/6] libmultipath: make sysfs_is_multipathed able to return wwid

2020-05-18 Thread Benjamin Marzinski
sysfs_is_multipathed reads the wwid of the dm device holding a path to check if its a multipath device. Add code to optinally set pp->wwid to that wwid. This will be used by a future patch. Reviewed-by: Martin Wilck Signed-off-by: Benjamin Marzinski --- libmultipath/sysfs.c |

[dm-devel] [PATCH v2 4/6] Unit tests for is_path_valid()

2020-05-18 Thread Benjamin Marzinski
Signed-off-by: Benjamin Marzinski --- tests/Makefile | 4 +- tests/valid.c | 486 + 2 files changed, 489 insertions(+), 1 deletion(-) create mode 100644 tests/valid.c diff --git a/tests/Makefile b/tests/Makefile index 77ff3249..7fc261c3 100644

[dm-devel] [PATCH v2 6/6] libmultipath: use atomic linkat() in mark_failed_wwid()

2020-05-18 Thread Benjamin Marzinski
-off-by: Benjamin Marzinski --- libmultipath/wwids.c | 42 +- 1 file changed, 29 insertions(+), 13 deletions(-) diff --git a/libmultipath/wwids.c b/libmultipath/wwids.c index da55924b..c7a16636 100644 --- a/libmultipath/wwids.c +++ b/libmultipath/wwids.c

[dm-devel] [PATCH v2 1/6] libmultipath: make libmp_dm_init optional

2020-05-18 Thread Benjamin Marzinski
. Also make dm_prereq a global function. Reviewed-by: Martin Wilck Signed-off-by: Benjamin Marzinski --- libmultipath/devmapper.c | 17 + libmultipath/devmapper.h | 3 ++- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/libmultipath/devmapper.c b/libmultipath

[dm-devel] [PATCH v2 5/6] libmultipath: simplify failed wwid code

2020-05-18 Thread Benjamin Marzinski
the locking work (which made it necessary to write a file, even just to check if a file existed), simply check for files with lstat(), create them with open(), and remove them with unlink(). Reviewed-by: Martin Wilck Signed-off-by: Benjamin Marzinski --- libmultipath/wwids.c | 131

[dm-devel] [PATCH v2 3/6] multipath: centralize validation code

2020-05-18 Thread Benjamin Marzinski
. This code will give almost the same answer as the existing code, with the exception that now, if a device is currently multipathed, it will always be a valid multipath path. Signed-off-by: Benjamin Marzinski --- libmultipath/Makefile| 3 +- libmultipath/devmapper.c | 45

Re: [dm-devel] [PATCH 4/6] Unit tests for is_path_valid()

2020-05-18 Thread Benjamin Marzinski
On Fri, May 15, 2020 at 08:37:23PM +, Martin Wilck wrote: > On Thu, 2020-05-14 at 20:59 -0500, Benjamin Marzinski wrote: > > Signed-off-by: Benjamin Marzinski > > Two minor nits below, otherwise ack. Sure. I can fix those up. -Ben > > > --- > > tests/Makefi

Re: [dm-devel] [PATCH 3/6] multipath: centralize validation code

2020-05-18 Thread Benjamin Marzinski
On Fri, May 15, 2020 at 08:37:16PM +, Martin Wilck wrote: > On Thu, 2020-05-14 at 20:59 -0500, Benjamin Marzinski wrote: > > This code pulls the multipath path validation code out of > > configure(), > > and puts it into its own function, check_path_valid(). This fun

Re: [dm-devel] [PATCH 0/6] multipath: path validation library prep work

2020-05-15 Thread Benjamin Marzinski
On Thu, May 14, 2020 at 08:59:16PM -0500, Benjamin Marzinski wrote: > I've been playing around with the SID code more and I've decided to hold > off on submitting the library until I have it working with the SID > multipath module better. Instead, I've pulled out the common code that &g

[dm-devel] [PATCH 5/6] libmultipath: simplify failed wwid code

2020-05-14 Thread Benjamin Marzinski
the locking work (which made it necessary to write a file, even just to check if a file existed), simply check for files with lstat(), create them with open(), and remove them with unlink(). Signed-off-by: Benjamin Marzinski --- libmultipath/wwids.c | 131 ++- 1

[dm-devel] [PATCH 6/6] libmultipath: use atomic linkat() in mark_failed_wwid()

2020-05-14 Thread Benjamin Marzinski
-off-by: Benjamin Marzinski --- libmultipath/wwids.c | 42 +- 1 file changed, 29 insertions(+), 13 deletions(-) diff --git a/libmultipath/wwids.c b/libmultipath/wwids.c index aab5da8a..61d9c39e 100644 --- a/libmultipath/wwids.c +++ b/libmultipath/wwids.c

[dm-devel] [PATCH 2/6] libmultipath: make sysfs_is_multipathed able to return wwid

2020-05-14 Thread Benjamin Marzinski
sysfs_is_multipathed reads the wwid of the dm device holding a path to check if its a multipath device. Add code to optinally set pp->wwid to that wwid. This will be used by a future patch. Signed-off-by: Benjamin Marzinski --- libmultipath/sysfs.c | 24 +++- libmultip

[dm-devel] [PATCH 3/6] multipath: centralize validation code

2020-05-14 Thread Benjamin Marzinski
. This code will give almost the same answer as the existing code, with the exception that now, if a device is currently multipathed, it will always be a valid multipath path. Signed-off-by: Benjamin Marzinski --- libmultipath/Makefile| 2 +- libmultipath/devmapper.c | 49

[dm-devel] [PATCH 1/6] libmultipath: make libmp_dm_init optional

2020-05-14 Thread Benjamin Marzinski
. Also make dm_prereq a global function. Reviewed-by: Martin Wilck Signed-off-by: Benjamin Marzinski --- libmultipath/devmapper.c | 17 + libmultipath/devmapper.h | 3 ++- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/libmultipath/devmapper.c b/libmultipath

[dm-devel] [PATCH 4/6] Unit tests for is_path_valid()

2020-05-14 Thread Benjamin Marzinski
Signed-off-by: Benjamin Marzinski --- tests/Makefile | 4 +- tests/valid.c | 424 + 2 files changed, 427 insertions(+), 1 deletion(-) create mode 100644 tests/valid.c diff --git a/tests/Makefile b/tests/Makefile index 1b8706a7..125553b8 100644

Re: [dm-devel] [PATCH 0/2] More minor libmultipath fixes

2020-05-14 Thread Benjamin Marzinski
move is a long-overdue cleanup. > Reviewed-by: Benjamin Marzinski For the set > Regards > Martin > > Martin Wilck (2): > libmultipath: move libsg into libmultipath > multipath-tools Makefile: add install dependency > > Makefile

Re: [dm-devel] [PATCH 00/11] Minor fixes for multipath-tools

2020-05-14 Thread Benjamin Marzinski
; on our build server. > > Regards > Martin Reviewed-by: Benjamin Marzinski For the set. > > Martin Wilck (11): > multipath-tools: Makefile: more dependency fixes for parallel build > multipath-tools: Makefile.inc: separate out OPTFLAGS > multipath-tools:

Re: [dm-devel] [PATCH] libmultipath: simplify failed wwid code

2020-05-08 Thread Benjamin Marzinski
On Fri, May 08, 2020 at 09:15:32AM +, Martin Wilck wrote: > On Fri, 2020-05-01 at 17:39 -0500, Benjamin Marzinski wrote: > > The (is|mark|unmark)_failed_wwid code is needlessly complicated. > > Locking a file is necssary if multiple processes could otherwise be > > writ

Re: [dm-devel] [RFC PATCH v2 0/3] multipath: new path validation library

2020-05-01 Thread Benjamin Marzinski
On Tue, Apr 28, 2020 at 09:48:03PM +, Martin Wilck wrote: > On Fri, 2020-04-03 at 01:50 -0500, Benjamin Marzinski wrote: > > This patchset is for a new library that programs can use to determine > > if a device belongs to multipath. The primary user that this is > >

Re: [dm-devel] [RFC PATCH v2 3/3] multipath: add libmpathvalid library

2020-05-01 Thread Benjamin Marzinski
On Tue, Apr 28, 2020 at 09:42:52PM +, Martin Wilck wrote: > On Fri, 2020-04-03 at 01:50 -0500, Benjamin Marzinski wrote: > > +int mpath_get_mode(void) > > +{ > > + int mode; > > + struct config *conf; > > + > > + conf = load_config(DEFAULT_CONF

Re: [dm-devel] [RFC Patch 3/3] multipath: add libmpathvalid library

2020-04-03 Thread Benjamin Marzinski
On Fri, Apr 03, 2020 at 09:14:58AM +, Martin Wilck wrote: > Hi Ben, > > On Tue, 2020-03-31 at 12:31 -0500, Benjamin Marzinski wrote: > > On Tue, Mar 31, 2020 at 03:38:25PM +, Martin Wilck wrote: > > > On Mon, 2020-03-30 at 21:00 -0500, Benjamin Marzinski wrote: >

Re: [dm-devel] [PATCH v2 2/2] kpartx.rules: check for skip_kpartx on synthetic uevents

2020-04-03 Thread Benjamin Marzinski
quot; events with DM_ACTIVATION=="1". > > 11-dm-mpath.rules resets DM_ACTIVATION to 0 if nothing should change in upper > layers. In this case importing DM_SUBSYSTEM_UDEV_FLAG1 is correct, too. kpartx > will not be called anyway, because 11-dm-mpath.rules also sets > MPATH_UNCH

Re: [dm-devel] [PATCH v2 1/2] kpartx.rules: honor DM_UDEV_DISABLE_OTHER_RULES_FLAG

2020-04-03 Thread Benjamin Marzinski
set up properly > by device-mapper before. This flag should be respected by kpartx. > Reviewed-by: Benjamin Marzinski > Signed-off-by: Martin Wilck > --- > kpartx/kpartx.rules | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/kpartx/kpartx.rules b/kpartx/kpartx.

[dm-devel] [RFC PATCH v2 2/3] libmultipath: make sysfs_is_multipathed able to return wwid

2020-04-03 Thread Benjamin Marzinski
sysfs_is_multipathed reads the wwid of the dm device holding a path to check if its a multipath device. Add code to optinally set pp->wwid to that wwid. This will be used by a future patch. Signed-off-by: Benjamin Marzinski --- libmultipath/sysfs.c | 24 +++- libmultip

[dm-devel] [RFC PATCH v2 1/3] libmultipath: make libmp_dm_init optional

2020-04-03 Thread Benjamin Marzinski
. Also make dm_prereq a global function. Reviewed-by: Martin Wilck Signed-off-by: Benjamin Marzinski --- libmultipath/devmapper.c | 17 + libmultipath/devmapper.h | 3 ++- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/libmultipath/devmapper.c b/libmultipath

[dm-devel] [RFC PATCH v2 0/3] multipath: new path validation library

2020-04-03 Thread Benjamin Marzinski
with this difference is the responsiblity of the caller of the mpathvalid library. mpath_get_mode(), will let it know what the configured find_multipaths mode is. Benjamin Marzinski (3): libmultipath: make libmp_dm_init optional libmultipath: make sysfs_is_multipathed able to return wwid multipath: add l

[dm-devel] [RFC PATCH v2 3/3] multipath: add libmpathvalid library

2020-04-03 Thread Benjamin Marzinski
g. It also uses a statically compiled version of libmultipath, both to keep that library from polluting the namespace of the caller, and to avoid the caller needing to set up the variables and functions (like logsink, and get_multipath_config) that it expects. Signed-off-by: Benjamin Marzinski ---

Re: [dm-devel] [RFC Patch 3/3] multipath: add libmpathvalid library

2020-03-31 Thread Benjamin Marzinski
On Tue, Mar 31, 2020 at 03:38:25PM +, Martin Wilck wrote: > On Mon, 2020-03-30 at 21:00 -0500, Benjamin Marzinski wrote: > > This library allows other programs to check if a path should be > > claimed > > by multipath. Currently, it only includes one function, > > m

Re: [dm-devel] [RFC Patch 2/3] libmultipath: make sysfs_is_multipathed able to return wwid

2020-03-31 Thread Benjamin Marzinski
On Tue, Mar 31, 2020 at 01:06:01PM +, Martin Wilck wrote: > On Mon, 2020-03-30 at 21:00 -0500, Benjamin Marzinski wrote: > > @@ -342,9 +342,25 @@ bool sysfs_is_multipathed(const struct path *pp) > > if (nr == sizeof(uuid) && !memcmp(uuid, &q

[dm-devel] [RFC Patch 3/3] multipath: add libmpathvalid library

2020-03-30 Thread Benjamin Marzinski
lso uses a statically compiled version of libmultipath, both to keep that library from polluting the namespace of the caller, and to avoid the caller needing to set up the variables and functions (like logsink, and get_multipath_config) that it expects. Signed-off-by: Ben

[dm-devel] [RFC Patch 0/3] multipath: new path validation library

2020-03-30 Thread Benjamin Marzinski
a path's WWID, without ever needing to open the path. Benjamin Marzinski (3): libmultipath: make libmp_dm_init optional libmultipath: make sysfs_is_multipathed able to return wwid multipath: add libmpathvalid library Makefile| 1 + Makefile.inc

[dm-devel] [RFC Patch 1/3] libmultipath: make libmp_dm_init optional

2020-03-30 Thread Benjamin Marzinski
. Also make dm_prereq a global function. Signed-off-by: Benjamin Marzinski --- libmultipath/devmapper.c | 17 + libmultipath/devmapper.h | 3 ++- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/libmultipath/devmapper.c b/libmultipath/devmapper.c index 13a1cf53

[dm-devel] [RFC Patch 2/3] libmultipath: make sysfs_is_multipathed able to return wwid

2020-03-30 Thread Benjamin Marzinski
sysfs_is_multipathed reads the wwid of the dm device holding a path to check if its a multipath device. Add code to optinally set pp->wwid to that wwid. This will be used by a future patch. Signed-off-by: Benjamin Marzinski --- libmultipath/sysfs.c | 22 +++--- libmultip

[dm-devel] [PATCH v2 3/3] libmultipath: allow force reload with no active paths

2020-03-25 Thread Benjamin Marzinski
ing kpartx when the first valid path appeared, even though the dm activation rules get run in this case. This changes 11-dm-mpath.rules to run kpartx when a device goes from no usable paths to having usable paths. Reviewed-by: Martin Wilck Signed-off-by: Benjamin Marzinski --- libmultipath/configur

[dm-devel] [PATCH v2 2/3] libmutipath: don't close fd on dm_lib_release

2020-03-25 Thread Benjamin Marzinski
, and update the version requirements if so. Signed-off-by: Benjamin Marzinski --- libmultipath/Makefile| 4 libmultipath/devmapper.c | 7 ++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/libmultipath/Makefile b/libmultipath/Makefile index e5651e49..ad690a49 100644

[dm-devel] [PATCH v2 1/3] libmultipath: assign variable to make gcc happy

2020-03-25 Thread Benjamin Marzinski
in this function [-Werror=maybe-uninitialized] bool is_queueing; ^~~ so, assign a value to make it happy. Reviewed-by: Martin Wilck Signed-off-by: Benjamin Marzinski --- libmultipath/structs_vec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libmultipath

Re: [dm-devel] [PATCH 2/3] libmutipath: don't close fd on dm_lib_release

2020-03-25 Thread Benjamin Marzinski
On Wed, Mar 25, 2020 at 03:52:55PM -0500, Benjamin Marzinski wrote: > On Wed, Mar 25, 2020 at 03:16:50PM +, Martin Wilck wrote: > > On Tue, 2020-03-24 at 16:03 -0500, Benjamin Marzinski wrote: > > > > AFAICS, this function has been in libdm since 1.02.111. We suppor

Re: [dm-devel] [PATCH 2/3] libmutipath: don't close fd on dm_lib_release

2020-03-25 Thread Benjamin Marzinski
On Wed, Mar 25, 2020 at 03:16:50PM +, Martin Wilck wrote: > On Tue, 2020-03-24 at 16:03 -0500, Benjamin Marzinski wrote: > > If dm_hold_control_open() isn't set, when dm_lib_release() is called, > > it > > will close the control fd. The control fd will get re-o

[dm-devel] [PATCH 1/3] libmultipath: assign variable to make gcc happy

2020-03-24 Thread Benjamin Marzinski
in this function [-Werror=maybe-uninitialized] bool is_queueing; ^~~ so, assign a value to make it happy. Signed-off-by: Benjamin Marzinski --- libmultipath/structs_vec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libmultipath/structs_vec.c b/libmultipath

[dm-devel] [PATCH 3/3] libmultipath: allow force reload with no active paths

2020-03-24 Thread Benjamin Marzinski
ing kpartx when the first valid path appeared, even though the dm activation rules get run in this case. This changes 11-dm-mpath.rules to run kpartx when a device goes from no usable paths to having usable paths. Signed-off-by: Benjamin Marzinski --- libmultipath/configure.c| 6 -- multi

[dm-devel] [PATCH 2/3] libmutipath: don't close fd on dm_lib_release

2020-03-24 Thread Benjamin Marzinski
happen with the vecs lock held, this wasn't too noticeable, but there is code that calls dm_task_run() without the vecs lock held, notably the dmevent waiter code. Signed-off-by: Benjamin Marzinski --- libmultipath/devmapper.c | 1 + 1 file changed, 1 insertion(+) diff --git a/libmultipath

Re: [dm-devel] [PATCH v2 4/4] libmpathpersist: ABI change: limit data-in/out size to 8192 bytes

2020-03-17 Thread Benjamin Marzinski
On Sun, Mar 15, 2020 at 10:05:21PM +0100, mwi...@suse.com wrote: > From: Martin Wilck > > Make sure that data structures used for PERSISTENT RESERVE IN/OUT > fit into 8k buffers. > > This patch breaks the libmpathpersist ABI, because the offsets of > struct print_fulldescr_list.descriptors and

Re: [dm-devel] [PATCH v2 2/4] libmpathpersist: format_transportids(): avoid PROUT overflow

2020-03-17 Thread Benjamin Marzinski
On Sun, Mar 15, 2020 at 10:05:19PM +0100, mwi...@suse.com wrote: > From: Martin Wilck > > This limits the PERSISTENT RESERVE OUT data size to max. 8192 bytes. > Reviewed-by: Benjamin Marzinski > Signed-off-by: Martin Wilck > --- > libmpathpersist/

Re: [dm-devel] [PATCH 4/4] libmpathpersist: ABI change: limit data-in/out size to 8192 bytes

2020-03-14 Thread Benjamin Marzinski
on't really see a way for users to hurt themselves because of this change, without making some pretty odd assumptions. Am I missing something? Reviewed-by: Benjamin Marzinski > Signed-off-by: Martin Wilck > --- > libmpathpersist/mpath_persist.h | 15 +++ > 1 file chang

Re: [dm-devel] [PATCH 3/4] libmpathpersist: mpath_format_readfullstatus(): use real buffer size

2020-03-14 Thread Benjamin Marzinski
On Sat, Mar 07, 2020 at 12:06:04AM +0100, mwi...@suse.com wrote: > From: Martin Wilck > > This changes no semantics, but it will allow changing the size of > prin_readfd.private_buffer in a follow-up patch. > Reviewed-by: Benjamin Marzinski > Signed-of

Re: [dm-devel] [PATCH 2/4] libmpathpersist: format_transportids(): avoid PROUT overflow

2020-03-14 Thread Benjamin Marzinski
On Sat, Mar 07, 2020 at 12:06:03AM +0100, mwi...@suse.com wrote: > From: Martin Wilck > > This limits the PERSISTENT RESERVE OUT data size to max. 8192 bytes. > > Signed-off-by: Martin Wilck > --- > libmpathpersist/mpath_pr_ioctl.c | 26 -- > 1 file changed, 24

Re: [dm-devel] [PATCH 1/4] libmpathpersist: limit PRIN allocation length to 8192 bytes

2020-03-14 Thread Benjamin Marzinski
the SCSI specs that > the allocation lengh may not exceed 8k, an 8k limit is also enforced > by sg_persist(8), and actually by mpathpersist itself for the > --allocation-length option, but not for the auto-determined length. > > Fix that. > Reviewed-by: Benjamin Marzins

Re: [dm-devel] [PATCH 0/4] multipath-tools unit test fixups

2020-03-13 Thread Benjamin Marzinski
On Mon, Mar 02, 2020 at 11:20:21PM +0100, mwi...@suse.com wrote: > From: Martin Wilck > > Hi Christophe, hi Ben, > > as announced in my previous post, here's a set of minor fixups for the > unit tests. The README.md should have been created long ago. My main > issue is that I'd prefer not to

Re: [dm-devel] multipath-tools merges

2020-03-13 Thread Benjamin Marzinski
On Mon, Mar 02, 2020 at 11:19:08AM +0100, Christophe Varoqui wrote: > Hi ben, Martin, > > I finally catched up with your changes from october till now. > Please review I did not mess up the merges, then i'll commit a version bump. Sorry for the delay. Everything looks fine on my end. -Ben > >

Re: [dm-devel] RFC: multipath-tools: NVMe native multipath and default setting for "enable_foreign"

2020-02-25 Thread Benjamin Marzinski
On Wed, Feb 19, 2020 at 05:17:48PM +0100, Martin Wilck wrote: > multipath-tools has support for "foreign" libraries in multipath-tools > since 0.8.0, and support for enabling/disabling them at runtime since > 0.8.3. > > The only foreign library that exists is "nvme" (for native NVMe > multipath),

[dm-devel] [PATCH v2 3/5] libmultipath: change loading and resetting in directio

2020-02-19 Thread Benjamin Marzinski
which is run when the checker is reset or unloaded. Changing this broke a number of tests, so the unit tests have been updated as well. Reviewed-by: Martin Wilck Signed-off-by: Benjamin Marzinski --- libmultipath/checkers.c | 26 ++--- libmultipath/checkers.h | 2

[dm-devel] [PATCH v2 2/5] libmultipath: turn pp->vpd_data into a pointer

2020-02-19 Thread Benjamin Marzinski
Instead of always allocating space in the path structure for vpd_data, only allocte it when necessary. Also, fix comments on vpd tests Reviewed-by: Martin Wilck Signed-off-by: Benjamin Marzinski --- libmultipath/discovery.c | 17 +++-- libmultipath/print.c | 4

[dm-devel] [PATCH v2 5/5] libmultipath: cleanup old issues with directio checker

2020-02-19 Thread Benjamin Marzinski
that in will virtually always set the path to pending on the check when the IO is issued. Reviewed-by: Martin Wilck Signed-off-by: Benjamin Marzinski --- libmultipath/checkers/directio.c | 13 - tests/directio.c | 1 - 2 files changed, 4 insertions(+), 10 deletions

[dm-devel] [PATCH v2 4/5] libmultipath: change directio get_events() timeout handling

2020-02-19 Thread Benjamin Marzinski
get_events() used a NULL or a zeroed timeout to mean "don't wait". io_getevents() uses a NULL timeout to mean "wait forever" and a zeroed timeout to mean "don't wait". Make get_events() work like io_getevents(). Reviewed-by: Martin Wilck Signed-off-by: Benjami

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

2020-02-19 Thread Benjamin Marzinski
Signed-off-by: Benjamin Marzinski --- kpartx/dasd.c| 6 +++--- libmultipath/print.c | 16 multipath/main.c | 2 +- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/kpartx/dasd.c b/kpartx/dasd.c index 1486ccaa..14b9d3aa 100644 --- a/kpartx/dasd.c

[dm-devel] [PATCH v2 0/5] Multipath Follow-up patches

2020-02-19 Thread Benjamin Marzinski
These patches resolve various minor issues that Martin had with my previous patch set. Changes in v2: 0001: now uses memcmp() instead of strncmp(), and safe_sprintf() instead of strlcpy(), as suggested by Martin Wilck. Benjamin Marzinski (5): multipath: fix issues found by compiling

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

2020-02-19 Thread Benjamin Marzinski
On Wed, Feb 19, 2020 at 10:28:31AM +0100, Martin Wilck wrote: > On Wed, 2020-02-19 at 00:54 -0600, Benjamin Marzinski wrote: > > Signed-off-by: Benjamin Marzinski > > --- > > kpartx/dasd.c| 6 +++--- > > libmultipath/print.c | 3 ++- > > multipath/main.

[dm-devel] [PATCH 4/5] libmultipath: change directio get_events() timeout handling

2020-02-18 Thread Benjamin Marzinski
get_events() used a NULL or a zeroed timeout to mean "don't wait". io_getevents() uses a NULL timeout to mean "wait forever" and a zeroed timeout to mean "don't wait". Make get_events() work like io_getevents(). Signed-off-by: Benjamin Marzinski --- libmult

[dm-devel] [PATCH 5/5] libmultipath: cleanup old issues with directio checker

2020-02-18 Thread Benjamin Marzinski
that in will virtually always set the path to pending on the check when the IO is issued. Signed-off-by: Benjamin Marzinski --- libmultipath/checkers/directio.c | 13 - tests/directio.c | 1 - 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/libmultipath

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

2020-02-18 Thread Benjamin Marzinski
Signed-off-by: Benjamin Marzinski --- kpartx/dasd.c| 6 +++--- libmultipath/print.c | 3 ++- multipath/main.c | 2 +- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/kpartx/dasd.c b/kpartx/dasd.c index 1486ccaa..57305825 100644 --- a/kpartx/dasd.c +++ b/kpartx/dasd.c

[dm-devel] [PATCH 2/5] libmultipath: turn pp->vpd_data into a pointer

2020-02-18 Thread Benjamin Marzinski
Instead of always allocating space in the path structure for vpd_data, only allocte it when necessary. Also, fix comments on vpd tests Signed-off-by: Benjamin Marzinski --- libmultipath/discovery.c | 17 +++-- libmultipath/print.c | 4 ++-- libmultipath/structs.c | 3

[dm-devel] [PATCH 3/5] libmultipath: change loading and resetting in directio

2020-02-18 Thread Benjamin Marzinski
which is run when the checker is reset or unloaded. Changing this broke a number of tests, so the unit tests have been updated as well. Signed-off-by: Benjamin Marzinski --- libmultipath/checkers.c | 26 ++--- libmultipath/checkers.h | 2 +- libmultipath/checkers/directio.c

[dm-devel] [PATCH 0/5] Multipath Follow-up patches

2020-02-18 Thread Benjamin Marzinski
These patches resolve various minor issues that Martin had with my previous patch set. Benjamin Marzinski (5): multipath: fix issues found by compiling with gcc 10 libmultipath: turn pp->vpd_data into a pointer libmultipath: change loading and resetting in directio libmultipath: cha

[dm-devel] [PATCH v3 18/18] tests: make directio tests able to work on a real device

2020-02-18 Thread Benjamin Marzinski
There is now a file in tests called directio_test_dev. If the commented out test device line is uncommented and set to a device, it can be used to test the directio checker on that device, instead of faking the device. Signed-off-by: Benjamin Marzinski --- tests/Makefile | 16

[dm-devel] [PATCH v3 03/18] Fix leak in mpathpersist

2020-02-18 Thread Benjamin Marzinski
If the persistent in command fails, the response buffer must be freed. Found by Coverity Reviewed-by: Martin Wilck Signed-off-by: Benjamin Marzinski --- mpathpersist/main.c | 1 + 1 file changed, 1 insertion(+) diff --git a/mpathpersist/main.c b/mpathpersist/main.c index 56761668..28bfe410

[dm-devel] [PATCH v3 16/18] fixup! libmultipath: add code to get vendor specific vpd data

2020-02-18 Thread Benjamin Marzinski
From: Martin Wilck Signed-off-by: Benjamin Marzinski --- libmultipath/discovery.c | 2 +- libmultipath/propsel.c | 2 +- libmultipath/propsel.h | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/libmultipath/discovery.c b/libmultipath/discovery.c index 33a313a2

[dm-devel] [PATCH v3 12/18] multipathd: add new paths under vecs lock

2020-02-18 Thread Benjamin Marzinski
Signed-off-by: Benjamin Marzinski --- multipathd/main.c | 16 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/multipathd/main.c b/multipathd/main.c index a590ba8d..e607acf3 100644 --- a/multipathd/main.c +++ b/multipathd/main.c @@ -872,9 +872,8 @@ uev_add_path (struct

[dm-devel] [PATCH v3 09/18] libmultipath: add code to get vendor specific vpd data

2020-02-18 Thread Benjamin Marzinski
in the devices section of multipath.conf with the vpd_vendor parameter. Currently, the only devices that use this are HPE 3PAR arrays, to return the Volume Name. Signed-off-by: Benjamin Marzinski --- libmultipath/config.c | 2 ++ libmultipath/config.h | 1 + libmultipath/dict.c

[dm-devel] [PATCH v3 14/18] libmultipath: make directio checker share io contexts

2020-02-18 Thread Benjamin Marzinski
sts, then no checker can use it. Since no checker is using it, there is no checker to clear out the orphaned requests. In this (likely rare) case, the last checker from that group to be freed and leave behind an orphaned request will call io_destroy() and remove the group. Signed-off-by: Benjamin Marzin

[dm-devel] [PATCH v3 07/18] libmultipath: fix sgio_get_vpd looping

2020-02-18 Thread Benjamin Marzinski
, modify the tests to verify the new behavior. Signed-off-by: Benjamin Marzinski --- libmultipath/discovery.c | 12 +++ tests/vpd.c | 77 2 files changed, 52 insertions(+), 37 deletions(-) diff --git a/libmultipath/discovery.c b/libmultipath

[dm-devel] [PATCH v3 02/18] multipathd: staticify uxlsnr variables/functions

2020-02-18 Thread Benjamin Marzinski
Signed-off-by: Benjamin Marzinski --- multipathd/uxlsnr.c | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/multipathd/uxlsnr.c b/multipathd/uxlsnr.c index 020d7a9b..1c5ce9d2 100644 --- a/multipathd/uxlsnr.c +++ b/multipathd/uxlsnr.c @@ -40,7 +40,7 @@ #include

[dm-devel] [PATCH v3 13/18] libmultipath: add new checker class functions

2020-02-18 Thread Benjamin Marzinski
. They are designed to setup, reset, and destroy global state that all checkers of this class use. They will be used in future commits. Reviewed-by: Martin Wilck Signed-off-by: Benjamin Marzinski --- libmultipath/checkers.c | 29 - libmultipath/checkers.h | 1 + multipathd

[dm-devel] [PATCH v3 05/18] libmultipath: constify get_unaligned_be*

2020-02-18 Thread Benjamin Marzinski
Reviewed-by: Martin Wilck Signed-off-by: Benjamin Marzinski --- libmultipath/unaligned.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libmultipath/unaligned.h b/libmultipath/unaligned.h index 68c07742..b9eaa7cb 100644 --- a/libmultipath/unaligned.h +++ b/libmultipath

[dm-devel] [PATCH v3 10/18] libmultipath: change how the checker async is set

2020-02-18 Thread Benjamin Marzinski
set that checker class to async (assuming force_sync wasn't set). After that, no matter when a checker from that class was called, it would always run in async mode. Multipathd doesn't need to run checkers in sync mode at all, so don't. Reviewed-by: Martin Wilck Signed-off-by: Benjamin Marzinski

[dm-devel] [PATCH v3 04/18] libmultipath: remove unused path->prio_args

2020-02-18 Thread Benjamin Marzinski
Reviewed-by: Martin Wilck Signed-off-by: Benjamin Marzinski --- libmultipath/structs.h | 1 - 1 file changed, 1 deletion(-) diff --git a/libmultipath/structs.h b/libmultipath/structs.h index c978fb8a..250623af 100644 --- a/libmultipath/structs.h +++ b/libmultipath/structs.h @@ -273,7 +273,6

[dm-devel] [PATCH v3 08/18] libmultipath: add vend_id to get_vpd_sgio

2020-02-18 Thread Benjamin Marzinski
This tells multipath how it should decode vendor specific pages. It will be used by a future patch. Reviewed-by: Martin Wilck Signed-off-by: Benjamin Marzinski --- libmultipath/discovery.c | 4 ++-- libmultipath/discovery.h | 2 +- libmultipath/propsel.c | 2 +- tests/vpd.c

[dm-devel] [PATCH v3 01/18] multipathd: warn when configuration has been changed.

2020-02-18 Thread Benjamin Marzinski
repeatedly polling for files that aren't likely to appear. Signed-off-by: Benjamin Marzinski --- libmultipath/config.h | 1 + multipathd/main.c | 1 + multipathd/uxlsnr.c | 138 -- 3 files changed, 134 insertions(+), 6 deletions(-) diff --git

[dm-devel] [PATCH v3 00/18] Multipath patch dump

2020-02-18 Thread Benjamin Marzinski
he directio tests on an actual device Benjamin Marzinski (16): multipathd: warn when configuration has been changed. multipathd: staticify uxlsnr variables/functions Fix leak in mpathpersist libmultipath: remove unused path->prio_args libmultipath: constify get_unaligned_be* libmultip

[dm-devel] [PATCH v3 11/18] libmultipath: change failed path prio timeout

2020-02-18 Thread Benjamin Marzinski
talking to the device, multipath shouldn't completely skip attempting to get the priority of these paths, but it should set a small timeout, so that it isn't hanging in the case where it needs to contact a device through a failed path. Signed-off-by: Benjamin Marzinski --- libmultipath/discovery.c

<    6   7   8   9   10   11   12   13   14   15   >