[dm-devel] [PATCH v2 2/8] kpartx: fix -Wsign-compare error

2020-08-11 Thread Benjamin Marzinski
Reviewed-by: Martin Wilck Signed-off-by: Benjamin Marzinski --- kpartx/kpartx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kpartx/kpartx.c b/kpartx/kpartx.c index c24ad6d9..653ce0c8 100644 --- a/kpartx/kpartx.c +++ b/kpartx/kpartx.c @@ -738,7 +738,7 @@ struct block

[dm-devel] [PATCH v2 4/8] libmultipath: count pending paths as active on loads

2020-08-11 Thread Benjamin Marzinski
reinstated. However, this could lead to newly created multipath devices failing IO, simply because the path checkers hadn't returned yet. Having udev assume that the the device is up, like the kernel does, seems like the safer option. Reviewed-by: Martin Wilck Signed-off-by: Benjamin Marzinski

[dm-devel] [PATCH v2 7/8] multipathd: unset mpp->hwe when removing map

2020-08-11 Thread Benjamin Marzinski
If the map doesn't unset its hwe pointer before orphaning all the paths, multipathd will print a warning message in orphan_path() because of commit "libmultipath: warn if freeing path that holds mpp->hwe". Signed-off-by: Benjamin Marzinski --- libmultipath/structs_vec.c | 1 + mult

Re: [dm-devel] [PATCH 69/74] libmultipath: disassemble_map(): get rid of "is_daemon" argument

2020-08-10 Thread Benjamin Marzinski
On Wed, Aug 05, 2020 at 10:05:19PM +0200, Martin Wilck wrote: > On Sun, 2020-07-19 at 00:26 -0500, Benjamin Marzinski wrote: > > On Thu, Jul 09, 2020 at 12:51:40PM +0200, mwi...@suse.com wrote: > > > From: Martin Wilck > > > > > > The reason for the is_daemon

Re: [dm-devel] [PATCH 44/54] libmultipath: adopt_paths(): don't bail out on single path failure

2020-08-10 Thread Benjamin Marzinski
On Wed, Aug 05, 2020 at 02:05:00PM +0200, Martin Wilck wrote: > On Fri, 2020-07-17 at 16:25 -0500, Benjamin Marzinski wrote: > > On Thu, Jul 09, 2020 at 12:36:13PM +0200, mwi...@suse.com wrote: > > > From: Martin Wilck > > > > > > If pathinfo fails for

Re: [dm-devel] [PATCH 3/6] libmultipath: remove code duplication in path counting

2020-08-10 Thread Benjamin Marzinski
On Thu, Aug 06, 2020 at 10:48:12AM +, Martin Wilck wrote: > On Mon, 2020-07-27 at 14:24 -0500, Benjamin Marzinski wrote: > > pathcountgr() is never used except by pathcount(), and neither is the > > special case for PATH_WILD. Simplify this and make one function that > >

Re: [dm-devel] [PATCH V2] libmultipath: free pp if store_path fails in disassemble_map

2020-08-10 Thread Benjamin Marzinski
On Mon, Aug 10, 2020 at 02:20:27PM +0200, Martin Wilck wrote: > Hello Liu, > > On Fri, 2020-07-24 at 09:40 +0800, Zhiqiang Liu wrote: > > In disassemble_map func, one pp will be allocated and stored in > > pgp->paths. However, if store_path fails, pp will not be freed, > > then memory leak

Re: [dm-devel] [PATCH 08/35] libmultipath: create bitfield abstraction

2020-08-10 Thread Benjamin Marzinski
On Tue, Aug 04, 2020 at 09:35:08PM +0200, Martin Wilck wrote: > On Tue, 2020-08-04 at 11:26 -0500, Benjamin Marzinski wrote: > > On Tue, Aug 04, 2020 at 05:18:18PM +0200, Martin Wilck wrote: > > > On Tue, 2020-08-04 at 17:04 +0200, Martin Wilck wrote: > > > > On

Re: [dm-devel] [PATCH 12/35] libmultipath: strlcpy()/strlcat(): use restrict qualifier

2020-08-04 Thread Benjamin Marzinski
On Tue, Aug 04, 2020 at 05:36:31PM +0200, Martin Wilck wrote: > On Thu, 2020-07-16 at 17:18 -0500, Benjamin Marzinski wrote: > > On Thu, Jul 09, 2020 at 12:15:57PM +0200, mwi...@suse.com wrote: > > > From: Martin Wilck > > > > > > Also remove the redundant

Re: [dm-devel] [PATCH 08/35] libmultipath: create bitfield abstraction

2020-08-04 Thread Benjamin Marzinski
On Tue, Aug 04, 2020 at 05:18:18PM +0200, Martin Wilck wrote: > On Tue, 2020-08-04 at 17:04 +0200, Martin Wilck wrote: > > On Thu, 2020-07-16 at 16:17 -0500, Benjamin Marzinski wrote: > > > On Thu, Jul 09, 2020 at 12:15:53PM +0200, mwi...@suse.com wrote: > > > > From:

Re: [dm-devel] [dm- devel][PATCH] tests/hwtable: fix a memory free in replicate_config

2020-08-03 Thread Benjamin Marzinski
On Mon, Aug 03, 2020 at 10:43:54AM +0800, Zhiqiang Liu wrote: > > In replicate_config func, hwtable is allocated by calling get_used_hwes > func, however it is not freed. > > Signed-off-by: Zhiqiang Liu Reviewed-by: Benjamin Marzinski > --- > tests/hwtable.c | 1 +

Re: [dm-devel] [dm- devel][PATCH] vector: add lower bound check of E in VECTOR_SLOT

2020-08-03 Thread Benjamin Marzinski
On Mon, Aug 03, 2020 at 10:41:48AM +0800, Zhiqiang Liu wrote: > > In VECTOR_SLOT(V, E), we add the lower bound check of E. > E cannot be less than zero. > > Signed-off-by: Zhiqiang Liu Reviewed-by: Benjamin Marzinski > --- > libmultipath/vector.h | 2 +- > 1 file ch

Re: [dm-devel] [dm- devel][PATCH] vector: fix upper boundary check of vector size in vector_del_slot

2020-08-03 Thread Benjamin Marzinski
On Mon, Aug 03, 2020 at 10:39:29AM +0800, Zhiqiang Liu wrote: > > In vector_del_slot func, legal value of input slot is in range of > [0, VECTOR_SIZE(v)), it means slot value should be less then VECTOR_SIZE(v). > > > Signed-off-by: Zhiqiang Liu Reviewed-by:

Re: [dm-devel] [PATCH] libmultipath: fix null dereference in add

2020-08-03 Thread Benjamin Marzinski
it. This patch looks fine. However, it has pointed out a larger problem with the udev_device_get_* functions. This is not the only instance where we aren't checking the return value of these functions before dereferencing it. -Ben Reviewed-by: Benjamin Marzinski > Signed-off-by: lut

Re: [dm-devel] [dm- devel][PATCH] vector: return null when realloc fails in vector_alloc_slot func

2020-07-31 Thread Benjamin Marzinski
t old slot as the new allocated slot, and use it by calling > vector_set_slot func. Finally, the data of last slot is lost. > Reviewed-by: Benjamin Marzinski > Here, if REALLOC or MALLOC fails, we will return NULL. > > Signed-off-by: Zhiqiang Liu > Signed-off-by: lixiaoke

Re: [dm-devel] [PATCH] devmapper: remove useless using of memset in dm_get_info func

2020-07-30 Thread Benjamin Marzinski
hiqiang Liu Reviewed-by: Benjamin Marzinski > --- > libmultipath/devmapper.c | 1 - > 1 file changed, 1 deletion(-) > > diff --git a/libmultipath/devmapper.c b/libmultipath/devmapper.c > index f597ff8b..00ee0dfc 100644 > --- a/libmultipath/devmapper.c > +++ b/libmultipath/de

Re: [dm-devel] [PATCH] libmultipath: fix a memory leak in set_ble_device

2020-07-30 Thread Benjamin Marzinski
ing for something to base upstream patches on, that's what you want. > Signed-off-by: Lixiaokeng > Signed-off-by: Zhiqiang Liu Reviewed-by: Benjamin Marzinski > > --- > libmultipath/blacklist.c | 74 +++- > libmultipath/blacklist.h | 4 +--

Re: [dm-devel] [dm- devel][PATCH] libmultipath: fix a memory leak in dm_get_maps

2020-07-30 Thread Benjamin Marzinski
On Thu, Jul 30, 2020 at 12:01:36PM +0800, lixiaokeng wrote: > In dm_get_maps func, if vector_alloc_slot(mp) fails, the > mpp should be free. > > Here we call free_multipath(mpp, KEEP_PATHS) to free map. > > Signed-off-by: Lixiaokeng > Signed-off-by: Zhiqiang Liu

Re: [dm-devel] [PATCH] libmultipath: fix a memory leak in disassemble_status func

2020-07-28 Thread Benjamin Marzinski
r the patch itself (assuming that the correct answer isn't to just delete the least-pending code), Reviewed-by: Benjamin Marzinski > Signed-off-by: Zhiqiang Liu > Signed-off-by: lixiaokeng > --- > libmultipath/dmparser.c | 1 + > 1 file changed, 1 insertion(+) > > di

[dm-devel] [PATCH 6/6] multipath: deal with delegation failures correctly

2020-07-27 Thread Benjamin Marzinski
Signed-off-by: Benjamin Marzinski --- multipath/main.c | 9 ++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/multipath/main.c b/multipath/main.c index 4c43314e..3da692dc 100644 --- a/multipath/main.c +++ b/multipath/main.c @@ -861,9 +861,12 @@ int delegate_to_multipathd(enum

[dm-devel] [PATCH 5/6] libmultipath: deal with flushing no maps

2020-07-27 Thread Benjamin Marzinski
dm_flush_maps() was failing if there were no device-mapper devices at all, instead of returning success, since there is nothing to do. Fixes: "libmultipath: make dm_flush_maps only return 0 on success" Signed-off-by: Benjamin Marzinski --- libmultipath/devmapper.c | 2 +- 1 file

[dm-devel] [PATCH 0/6] multipath cleanups

2020-07-27 Thread Benjamin Marzinski
Patches 0003 & 0004 fix an issue that I've seen with paths whose checker takes too long when multipathd is starting up and creating devices. The others are minor build fixes or small cleanups to my previous patchset. Benjamin Marzinski (6): Makefile.inc: trim extra information from sys

[dm-devel] [PATCH 2/6] kpartx: fix -Wsign-compare error

2020-07-27 Thread Benjamin Marzinski
Signed-off-by: Benjamin Marzinski --- kpartx/kpartx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kpartx/kpartx.c b/kpartx/kpartx.c index c24ad6d9..653ce0c8 100644 --- a/kpartx/kpartx.c +++ b/kpartx/kpartx.c @@ -738,7 +738,7 @@ struct block { /* blknr is always in 512

[dm-devel] [PATCH 1/6] Makefile.inc: trim extra information from systemd version

2020-07-27 Thread Benjamin Marzinski
Some systemd versions print extra information in the "pkg-config --modversion" output, which confuses make. Trim this off. Signed-off-by: Benjamin Marzinski --- Makefile.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile.inc b/Makefile.inc index e7256e3a

[dm-devel] [PATCH 3/6] libmultipath: remove code duplication in path counting

2020-07-27 Thread Benjamin Marzinski
-by: Benjamin Marzinski --- libmpathpersist/mpath_persist.c | 4 +-- libmultipath/structs.c | 47 + libmultipath/structs.h | 1 - 3 files changed, 21 insertions(+), 31 deletions(-) diff --git a/libmpathpersist/mpath_persist.c b/libmpathpersist

[dm-devel] [PATCH 4/6] libmultipath: count pending paths as active on loads

2020-07-27 Thread Benjamin Marzinski
reinstated. However, this could lead to newly created multipath devices failing IO, simply because the path checkers hadn't returned yet. Having udev assume that the the device is up, like the kernel does, seems like the safer option. Signed-off-by: Benjamin Marzinski --- libmultipath/devmapper.c | 3

Re: [dm-devel] [dm-level] upstream-queue-libmultipath: fix memory leak when iscsi login/out and "multipath -r" executed

2020-07-27 Thread Benjamin Marzinski
On Sat, Jul 25, 2020 at 01:47:01PM +0800, lixiaokeng wrote: > When one iscsi device logs in and logs out with the "multipath -r" > executed at the same time, memory leak happens in multipathd > process. > > The reason is following. When "multipath -r" is executed, the path > will be free in

Re: [dm-devel] [PATCH V2] libmultipath: free pp if store_path fails in disassemble_map

2020-07-24 Thread Benjamin Marzinski
n store_path fails. > Reviewed-by: Benjamin Marzinski > Signed-off-by: Zhiqiang Liu > Signed-off-by: lixiaokeng > --- > V1->V2: update based on ups/submit-2007 branch. > > libmultipath/dmparser.c | 9 +++-- > 1 file changed, 7 insertions(+), 2 deletions(-

Re: [dm-devel] [PATCH] libmultipath: free pp if store_path fails in disassemble_map

2020-07-23 Thread Benjamin Marzinski
On Thu, Jul 23, 2020 at 09:28:51AM +0800, Zhiqiang Liu wrote: > > > On 2020/7/23 4:53, Benjamin Marzinski wrote: > > On Wed, Jul 22, 2020 at 04:41:28PM +0800, Zhiqiang Liu wrote: > >> In disassemble_map func, one pp will be allocated and stored in pathvec > >&

Re: [dm-devel] [PATCH] libmultipath: free pgp if add_pathgroup fails in disassemble_map func

2020-07-22 Thread Benjamin Marzinski
call free_pathgroup(pgp) before going to out tag. > Reviewed-by: Benjamin Marzinski > Signed-off-by: Zhiqiang Liu > Signed-off-by: lixiaokeng > --- > libmultipath/dmparser.c | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > > diff --git a/libmultipath/dmpa

Re: [dm-devel] [PATCH 00/80] multipath-tools series part VI: incomplete udev initialization

2020-07-20 Thread Benjamin Marzinski
ries will also be available here: > https://github.com/mwilck/multipath-tools/tree/ups/submit-2007 > > There are tags in that repo for each part of the series. > This part is tagged "submit-200709-6". for the part Reviewed-by: Benjamin Marzinski > The series handle

Re: [dm-devel] [PATCH 00/74] multipath-tools series part V: removed path handling

2020-07-20 Thread Benjamin Marzinski
ries will also be available here: > https://github.com/mwilck/multipath-tools/tree/ups/submit-2007 > > There are tags in that repo for each part of the series. > This part is tagged "submit-200709-5". For the part, with the exception of patches 61,63,64,65,66 & 71 Review

Re: [dm-devel] [PATCH 00/54] multipath-tools series part IV: identify paths by dev_t

2020-07-20 Thread Benjamin Marzinski
; The full series will also be available here: > https://github.com/mwilck/multipath-tools/tree/ups/submit-2007 > > There are tags in that repo for each part of the series. > This part is tagged "submit-200709-4". For the part, with the exception of patches 44 & 46 Reviewed-by: Ben

Re: [dm-devel] [PATCH 42/42] libmultipath: dm_addmap(): refuse creating map with empty WWID

2020-07-20 Thread Benjamin Marzinski
t we can't call > dm_addmap(ACT_CREATE) with an empty WWID is update_path_groups()-> > reload_map(). To make the code easier to review and avoid ugly > corner cases, simply refuse to create maps with a zero-length > WWID. > Reviewed-by: Benjamin Marzinski > Signed-off-by: Martin Wilc

Re: [dm-devel] [PATCH 00/35] multipath-tools series part I: minor changes

2020-07-20 Thread Benjamin Marzinski
> > The full series will also be available here: > https://github.com/mwilck/multipath-tools/tree/ups/submit-2007 > > There are tags in that repo for each part of the series. > This part is tagged "submit-200709-1". For the part, with the exception of patches 8 &am

Re: [dm-devel] [PATCH 00/42] multipath-tools series part III: duplicate alias

2020-07-20 Thread Benjamin Marzinski
On Thu, Jul 09, 2020 at 12:35:10PM +0200, mwi...@suse.com wrote: > From: Martin Wilck > > Hi Christophe, hi Ben, > > This is part II of a larger patch series for multpath-tools I've been > preparing. > It contains fixes for a customer issue where the same alias was set for > several maps with

Re: [dm-devel] [PATCH 76/80] libmultipath: select_action(): force udev reload for uninitialized maps

2020-07-19 Thread Benjamin Marzinski
On Thu, Jul 09, 2020 at 01:03:26PM +0200, mwi...@suse.com wrote: > From: Martin Wilck > > If we are in the reconfigure() code path, and we encounter maps to > be reloaded, we usually set the DM_SUBSYSTEM_UDEV_FLAG0 flag to tell > udev not to repeat device detection steps above the multipath

Re: [dm-devel] [PATCH 71/74] multipath: use update_pathvec_from_dm()

2020-07-19 Thread Benjamin Marzinski
On Thu, Jul 09, 2020 at 12:51:42PM +0200, mwi...@suse.com wrote: > From: Martin Wilck > > The multipath-specific function update_paths() can now be replaced with > a call to update_pathvec_from_dm(). > > Signed-off-by: Martin Wilck > --- > multipath/main.c | 67

Re: [dm-devel] [PATCH 69/74] libmultipath: disassemble_map(): get rid of "is_daemon" argument

2020-07-18 Thread Benjamin Marzinski
On Thu, Jul 09, 2020 at 12:51:40PM +0200, mwi...@suse.com wrote: > From: Martin Wilck > > The reason for the is_daemon parameter in disassemble_map() lies > deep in multipath-tools' past, in b96dead ("[multipathd] remove the > retry login in uev_remove_path()"): By not adding paths from >

Re: [dm-devel] [PATCH 66/74] libmultipath: update_pathvec_from_dm: handle pp->mpp mismatch

2020-07-18 Thread Benjamin Marzinski
On Thu, Jul 09, 2020 at 12:51:37PM +0200, mwi...@suse.com wrote: > From: Martin Wilck > > Treat this like a WWID mismatch. > > Signed-off-by: Martin Wilck > --- > libmultipath/structs_vec.c | 37 +++-- > 1 file changed, 23 insertions(+), 14 deletions(-) > >

Re: [dm-devel] [PATCH 64/74] multipathd: check_path(): set retrigger_delay if necessary

2020-07-18 Thread Benjamin Marzinski
On Thu, Jul 09, 2020 at 12:51:35PM +0200, mwi...@suse.com wrote: > From: Martin Wilck > > In a follow up patch, we will set INIT_MISSING_UDEV and set tick=1 > (minimal) at the same time. In this case, which is new, check_path() > must reset the delay when it first triggers an uevent. Maybe I'm

Re: [dm-devel] [PATCH 65/74] libmultipath: add update_pathvec_from_dm()

2020-07-18 Thread Benjamin Marzinski
On Thu, Jul 09, 2020 at 12:51:36PM +0200, mwi...@suse.com wrote: > From: Martin Wilck > > It can happen in particular during boot or startup that we encounter > paths as map members which haven't been discovered or fully initialized > yet, and are thus not in the pathvec. These paths need

Re: [dm-devel] [PATCH 63/74] multipathd: deal with INIT_REMOVED during path addition

2020-07-17 Thread Benjamin Marzinski
On Thu, Jul 09, 2020 at 12:51:34PM +0200, mwi...@suse.com wrote: > From: Martin Wilck > > With the introduction of INIT_REMOVED, we have to deal with the situation > when a path is re-added in this state. This enables us to detect the > situation where a path is added while still part of a map

Re: [dm-devel] [PATCH 61/74] libmultipath: adopt_paths(): skip removed paths

2020-07-17 Thread Benjamin Marzinski
On Thu, Jul 09, 2020 at 12:51:32PM +0200, mwi...@suse.com wrote: > From: Martin Wilck > > If we don't do this, pathinfo() will fail on these paths, causing > adopt_paths() to fail. > This is probably unnecessary, but it seems safer to make sure that pp->mpp is set to mpp, before bailing out on

Re: [dm-devel] [PATCH 46/54] libmultipath: path_discover(): always set DI_BLACKLIST

2020-07-17 Thread Benjamin Marzinski
On Thu, Jul 09, 2020 at 12:36:15PM +0200, mwi...@suse.com wrote: > From: Martin Wilck > > Since 65e1845 ("multipath: call store_pathinfo with DI_BLACKLIST"), we > use DI_BLACKLIST for new paths. There's no reason why we shouldn't do the > same with paths which are (unexpectedly) already in

Re: [dm-devel] [PATCH 44/54] libmultipath: adopt_paths(): don't bail out on single path failure

2020-07-17 Thread Benjamin Marzinski
On Thu, Jul 09, 2020 at 12:36:13PM +0200, mwi...@suse.com wrote: > From: Martin Wilck > > If pathinfo fails for one path to be adopted, we currently > fail the entire function. This may cause ev_add_path() for a valid > path to fail because some other path is broken. Fix it by just > skipping

Re: [dm-devel] [PATCH 00/39] multipath-tools series part II: dev_loss_tmo fixes

2020-07-16 Thread Benjamin Marzinski
logging. > It's based on the previously submitted part I. > > The full series will also be available here: > https://github.com/mwilck/multipath-tools/tree/ups/submit-2007 > > There are tags in that repo for each part of the series. > This part is tagged "submit-200709-2&quo

Re: [dm-devel] [PATCH 12/35] libmultipath: strlcpy()/strlcat(): use restrict qualifier

2020-07-16 Thread Benjamin Marzinski
On Thu, Jul 09, 2020 at 12:15:57PM +0200, mwi...@suse.com wrote: > From: Martin Wilck > > Also remove the redundant local variables. It's not necessary to > make "restrict" work, but it makes the intention more clear. > > Signed-off-by: Martin Wilck > --- > libmultipath/util.c | 28

Re: [dm-devel] [PATCH 08/35] libmultipath: create bitfield abstraction

2020-07-16 Thread Benjamin Marzinski
On Thu, Jul 09, 2020 at 12:15:53PM +0200, mwi...@suse.com wrote: > From: Martin Wilck > > In e32d521d ("libmultipath: coalesce_paths: fix size mismatch handling"), > we introduced simple bitmap handling functions. We can do better. This > patch introduces a bitfield type with overflow detection

Re: [dm-devel] [PATCH 0/4] Fix segfault on access to mpp->hwe

2020-07-14 Thread Benjamin Marzinski
fetime and > can't be removed (e.g. because it's busy) is already covered by the > current code AFAICT. When a new path is re-added, we'll call adopt_paths > and verify_paths(), which will make sure that mpp->hwe is set again > to the pp->hwe member of the newly added path.

Re: [dm-devel] [lvm-devel] master - multipathd: fix fd leak when iscsi device logs in

2020-07-14 Thread Benjamin Marzinski
On Mon, Jul 13, 2020 at 09:59:43PM +0200, Martin Wilck wrote: > On Mon, 2020-07-13 at 11:56 +0200, Zdenek Kabelac wrote: > > > > > @Zdenek, do we have to protect every libdm call, or is it > > > sufficient > > > to protect only dm_task_run(), as lixiaokeng suggested? > > > > > > > Hi > > > >

[dm-devel] [PATCH v2 2/4] kpartx: read devices with direct IO

2020-07-02 Thread Benjamin Marzinski
this code should be reading 1024 bytes at minmum, I can certainly change this. But when I looked, I couldn't find a case where reading 512 bytes would cause a problem. Signed-off-by: Benjamin Marzinski --- kpartx/dasd.c | 7 --- kpartx/gpt.c| 22 +-- kpartx/kpartx.c

[dm-devel] [PATCH v2 0/4] misc patches

2020-07-02 Thread Benjamin Marzinski
by Martin. Benjamin Marzinski (4): libmultipath: fix sysfs dev_loss_tmo parsing kpartx: read devices with direct IO kpartx: handle alternate bsd disklabel location libmultipath: fix checker detection for nvme devices kpartx/bsd.c | 16 ++-- kpartx/dasd.c

[dm-devel] [PATCH v2 3/4] kpartx: handle alternate bsd disklabel location

2020-07-02 Thread Benjamin Marzinski
Signed-off-by: Benjamin Marzinski --- kpartx/bsd.c | 16 ++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/kpartx/bsd.c b/kpartx/bsd.c index 0e661fbc..950b0f92 100644 --- a/kpartx/bsd.c +++ b/kpartx/bsd.c @@ -1,6 +1,7 @@ #include "kpartx.h" #include

[dm-devel] [PATCH v2 1/4] libmultipath: fix sysfs dev_loss_tmo parsing

2020-07-02 Thread Benjamin Marzinski
dev_loss_tmo is a u32 value. However the kernel sysfs code prints it as a signed integer. This means that if dev_loss_tmo is above INT_MAX, the sysfs value will be a negative number. Parsing this was causing sysfs_set_rport_tmo() to fail. Signed-off-by: Benjamin Marzinski Signed-off-by: Martin

[dm-devel] [PATCH v2 4/4] libmultipath: fix checker detection for nvme devices

2020-07-02 Thread Benjamin Marzinski
should not assume that a devices is ALUA, simply because if failed to detect if alua was supported. Fixes: 8794a776 "libmultipath: fix ALUA autodetection when paths are down" Reviewed-by: Martin Wilck Signed-off-by: Benjamin Marzinski --- libmultipath/discovery.c | 6

[dm-devel] [PATCH v3 7/7] multipath: add option to skip multipathd delegation

2020-07-02 Thread Benjamin Marzinski
Add the -D option to allow users to skip delegating commands to multipathd. Reviewed-by: Martin Wilck Signed-off-by: Benjamin Marzinski --- libmultipath/config.h | 1 + multipath/main.c | 8 +++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/libmultipath/config.h b

[dm-devel] [PATCH v3 3/7] libmultipath: make dm_flush_maps only return 0 on success

2020-07-02 Thread Benjamin Marzinski
dm_flush_maps() returned both 0 and 1 on error, depending on which part of the function it was in, but the caller was always treating 0 as a success. Make dm_flush_maps() always return 1 on error and 0 on success. Reviewed-by: Martin Wilck Signed-off-by: Benjamin Marzinski --- libmultipath

[dm-devel] [PATCH v3 4/7] multipathd: add "del maps" multipathd command

2020-07-02 Thread Benjamin Marzinski
This will flush all multipath devices. Reviewed-by: Martin Wilck Signed-off-by: Benjamin Marzinski --- libmultipath/devmapper.c | 7 +-- libmultipath/devmapper.h | 2 +- multipath/main.c | 2 +- multipathd/cli.c | 1 + multipathd/cli_handlers.c | 19

[dm-devel] [PATCH v3 2/7] multipathd: fix check_path errors with removed map

2020-07-02 Thread Benjamin Marzinski
elp. If the path was missing from the multipath device, update_multipath_strings() would already catch that, and quit check_path() early, which make more sense to me than reloading does. Signed-off-by: Benjamin Marzinski --- multipathd/main.c | 44 +++- 1 f

[dm-devel] [PATCH v3 5/7] multipath: make flushing maps work like other commands

2020-07-02 Thread Benjamin Marzinski
The config structure doesn't need a special variable just for removes. Multipath can just use the cmd variable, like it does for the other commands. Reviewed-by: Martin Wilck Signed-off-by: Benjamin Marzinski --- libmultipath/config.h| 3 ++- libmultipath/configure.h | 3 --- multipath

[dm-devel] [PATCH v3 1/7] libmultipath: make dm_get_map/status return codes symbolic

2020-07-02 Thread Benjamin Marzinski
dm_get_map() and dm_get_status() now use symbolic return codes. They also differentiate between failing to get information from device-mapper and not finding the requested device. These symboilc return codes are also used by update_multipath_* functions. Signed-off-by: Benjamin Marzinski

[dm-devel] [PATCH v3 6/7] multipath: delegate flushing maps to multipathd

2020-07-02 Thread Benjamin Marzinski
itself. Reviewed-by: Martin Wilck Signed-off-by: Benjamin Marzinski --- multipath/main.c | 14 ++ multipath/multipath.8 | 4 ++-- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/multipath/main.c b/multipath/main.c index 101fd656..6a24e483 100644 --- a/multipath

[dm-devel] [PATCH v3 0/7] Fix muitpath/multipathd flush issue

2020-07-02 Thread Benjamin Marzinski
eturns. 0002: Changed symbolic return names, and improved some logging. Benjamin Marzinski (7): libmultipath: make dm_get_map/status return codes symbolic multipathd: fix check_path errors with removed map libmultipath: make dm_flush_maps only return 0 on success multipathd: add "del maps&q

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

2020-07-02 Thread Benjamin Marzinski
On Thu, Jul 02, 2020 at 11:52:21AM +, Martin Wilck wrote: > On Wed, 2020-03-25 at 17:00 -0500, Benjamin Marzinski wrote: > > 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: > > >

Re: [dm-devel] [PATCH 0/7] Fix muitpath/multipathd flush issue

2020-07-02 Thread Benjamin Marzinski
On Thu, Jul 02, 2020 at 04:45:21PM +, Martin Wilck wrote: > On Thu, 2020-07-02 at 10:18 -0500, Benjamin Marzinski wrote: > > On Thu, Jul 02, 2020 at 12:24:32PM +, Martin Wilck wrote: > > > On Wed, 2020-07-01 at 22:14 -0500, Benjamin Marzinski wrote: > > > >

Re: [dm-devel] [PATCH v2 2/7] multipathd: fix check_path errors with removed map

2020-07-02 Thread Benjamin Marzinski
On Wed, Jul 01, 2020 at 08:19:57PM +, Martin Wilck wrote: > On Thu, 2020-06-25 at 15:42 -0500, Benjamin Marzinski wrote: > > If a multipath device is removed during, or immediately before the > > call > > to check_path(), multipathd can behave incorrectly. A missing &g

Re: [dm-devel] [PATCH v2 1/7] libmultipath: make dm_get_map/status return codes symbolic

2020-07-02 Thread Benjamin Marzinski
On Wed, Jul 01, 2020 at 08:15:49PM +, Martin Wilck wrote: > On Thu, 2020-06-25 at 15:42 -0500, Benjamin Marzinski wrote: > > dm_get_map() and dm_get_status() now use symbolic return codes. They > > also differentiate between failing to get information from dev

Re: [dm-devel] [PATCH 2/4] kpartx: read devices with direct IO

2020-07-02 Thread Benjamin Marzinski
On Thu, Jul 02, 2020 at 03:00:37PM +, Martin Wilck wrote: > On Wed, 2020-07-01 at 17:39 -0500, Benjamin Marzinski wrote: > > If kpartx is used on top of shared storage, and a device has its > > partition table changed on one machine, and then kpartx is run on > > an

Re: [dm-devel] [PATCH 1/4] libmultipath: fix sysfs dev_loss_tmo parsing

2020-07-02 Thread Benjamin Marzinski
On Thu, Jul 02, 2020 at 02:31:17PM +, Martin Wilck wrote: > On Wed, 2020-07-01 at 17:39 -0500, Benjamin Marzinski wrote: > > dev_loss_tmo is a u32 value. However the kernel sysfs code prints it > > as > > a signed integer. This means that if dev_loss_tmo is above INT_M

Re: [dm-devel] [PATCH 3/4] kpartx: handle alternate bsd disklabel location

2020-07-02 Thread Benjamin Marzinski
On Thu, Jul 02, 2020 at 03:12:58PM +, Martin Wilck wrote: > On Wed, 2020-07-01 at 17:39 -0500, Benjamin Marzinski wrote: > > bsd disk labels can either be at the start of the second sector, or > > 64 > > bytes into the first sector, but kpartx only handled the fi

Re: [dm-devel] [PATCH 0/7] Fix muitpath/multipathd flush issue

2020-07-02 Thread Benjamin Marzinski
On Thu, Jul 02, 2020 at 12:24:32PM +, Martin Wilck wrote: > On Wed, 2020-07-01 at 22:14 -0500, Benjamin Marzinski wrote: > > On Wed, Jul 01, 2020 at 10:54:34PM +0200, Martin Wilck wrote: > > > On Thu, 2020-06-18 at 18:06 -0500, Benjamin Marzinski wrote: > > > &g

Re: [dm-devel] [PATCH 0/7] Fix muitpath/multipathd flush issue

2020-07-01 Thread Benjamin Marzinski
On Wed, Jul 01, 2020 at 10:54:34PM +0200, Martin Wilck wrote: > On Thu, 2020-06-18 at 18:06 -0500, Benjamin Marzinski wrote: > > > > I uploaded the test program, aio_test: > > > > https://github.com/bmarzins/test_programs.git > > > > You just need t

[dm-devel] [PATCH 1/4] libmultipath: fix sysfs dev_loss_tmo parsing

2020-07-01 Thread Benjamin Marzinski
dev_loss_tmo is a u32 value. However the kernel sysfs code prints it as a signed integer. This means that if dev_loss_tmo is above INT_MAX, the sysfs value will be a negative number. Parsing this was causing sysfs_set_rport_tmo() to fail. Signed-off-by: Benjamin Marzinski --- libmultipath

[dm-devel] [PATCH 4/4] libmultipath: fix checker detection for nvme devices

2020-07-01 Thread Benjamin Marzinski
should not assume that a devices is ALUA, simply because if failed to detect if alua was supported. Fixes: 8794a776 "libmultipath: fix ALUA autodetection when paths are down" Signed-off-by: Benjamin Marzinski --- libmultipath/discovery.c | 6 ++ libmultipath/propsel.c |

[dm-devel] [PATCH 3/4] kpartx: handle alternate bsd disklabel location

2020-07-01 Thread Benjamin Marzinski
bsd disk labels can either be at the start of the second sector, or 64 bytes into the first sector, but kpartx only handled the first case. However the second case is what parted creates, and what the linux kernel partition code expects. kpartx should handle both cases. Signed-off-by: Benjamin

[dm-devel] [PATCH 2/4] kpartx: read devices with direct IO

2020-07-01 Thread Benjamin Marzinski
this code should be reading 1024 bytes at minmum, I can certainly change this. But when I looked, I couldn't find a case where reading 512 bytes would cause a problem. Signed-off-by: Benjamin Marzinski --- kpartx/dasd.c | 7 --- kpartx/gpt.c| 22 ++ kpartx/kpartx.c

[dm-devel] [PATCH 0/4] misc patches

2020-07-01 Thread Benjamin Marzinski
This is a small collection of individual bug fix patches that apply on top of my previous patch set. Benjamin Marzinski (4): libmultipath: fix sysfs dev_loss_tmo parsing kpartx: read devices with direct IO kpartx: handle alternate bsd disklabel location libmultipath: fix checker detection

[dm-devel] [PATCH v2 5/7] multipath: make flushing maps work like other commands

2020-06-25 Thread Benjamin Marzinski
The config structure doesn't need a special variable just for removes. Multipath can just use the cmd variable, like it does for the other commands. Reviewed-by: Martin Wilck Signed-off-by: Benjamin Marzinski --- libmultipath/config.h| 3 ++- libmultipath/configure.h | 3 --- multipath

[dm-devel] [PATCH v2 0/7] Fix muitpath/multipathd flush issue

2020-06-25 Thread Benjamin Marzinski
re are likely still some conversations to be had about what we need to do to remove a device in multipath, and in what order. So, for now, I just kept all those functions the same, and just added the code necessary to make multpathd work with them correctly, as is. Benjamin Marzinski (7): libmu

[dm-devel] [PATCH v2 3/7] libmultipath: make dm_flush_maps only return 0 on success

2020-06-25 Thread Benjamin Marzinski
dm_flush_maps() returned both 0 and 1 on error, depending on which part of the function it was in, but the caller was always treating 0 as a success. Make dm_flush_maps() always return 1 on error and 0 on success. Reviewed-by: Martin Wilck Signed-off-by: Benjamin Marzinski --- libmultipath

[dm-devel] [PATCH v2 1/7] libmultipath: make dm_get_map/status return codes symbolic

2020-06-25 Thread Benjamin Marzinski
dm_get_map() and dm_get_status() now use symbolic return codes. They also differentiate between failing to get information from device-mapper and not finding the requested device. These symboilc return codes are also used by update_multipath_* functions. Signed-off-by: Benjamin Marzinski

[dm-devel] [PATCH v2 6/7] multipath: delegate flushing maps to multipathd

2020-06-25 Thread Benjamin Marzinski
itself. Signed-off-by: Benjamin Marzinski --- multipath/main.c | 14 ++ multipath/multipath.8 | 4 ++-- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/multipath/main.c b/multipath/main.c index 101fd656..6a24e483 100644 --- a/multipath/main.c +++ b/multipath/main.c

[dm-devel] [PATCH v2 7/7] multipath: add option to skip multipathd delegation

2020-06-25 Thread Benjamin Marzinski
Add the -D option to allow users to skip delegating commands to multipathd. Signed-off-by: Benjamin Marzinski --- libmultipath/config.h | 1 + multipath/main.c | 8 +++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/libmultipath/config.h b/libmultipath/config.h index

[dm-devel] [PATCH v2 4/7] multipathd: add "del maps" multipathd command

2020-06-25 Thread Benjamin Marzinski
This will flush all multipath devices. Signed-off-by: Benjamin Marzinski --- libmultipath/devmapper.c | 7 +-- libmultipath/devmapper.h | 2 +- multipath/main.c | 2 +- multipathd/cli.c | 1 + multipathd/cli_handlers.c | 19 +++ multipathd

[dm-devel] [PATCH v2 2/7] multipathd: fix check_path errors with removed map

2020-06-25 Thread Benjamin Marzinski
elp. If the path was missing from the multipath device, update_multipath_strings() would already catch that, and quit check_path() early, which make more sense to me than reloading does. Signed-off-by: Benjamin Marzinski --- multipathd/main.c | 37 ++--- 1 file chan

Re: [dm-devel] [PATCH 2/7] multipathd: fix check_path errors with removed map

2020-06-19 Thread Benjamin Marzinski
On Fri, Jun 19, 2020 at 01:42:47PM +, Martin Wilck wrote: > On Thu, 2020-06-18 at 18:17 -0500, Benjamin Marzinski wrote: > > On Thu, Jun 18, 2020 at 07:34:38PM +, Martin Wilck wrote: > > > On Wed, 2020-06-17 at 19:24 -0500, Benjamin Marzinski wrote: > > &

Re: [dm-devel] [PATCH 2/7] multipathd: fix check_path errors with removed map

2020-06-19 Thread Benjamin Marzinski
On Fri, Jun 19, 2020 at 08:32:34AM +0200, Hannes Reinecke wrote: > >> > >>fac68d7 is related to the famous "dm-multipath: Accept failed paths for > >>multipath maps" patch (e.g. > >>https://patchwork.kernel.org/patch/3368381/#7193001), which never made > >>it upstream. SUSE kernels have shipped

Re: [dm-devel] [PATCH 2/7] multipathd: fix check_path errors with removed map

2020-06-18 Thread Benjamin Marzinski
On Thu, Jun 18, 2020 at 07:34:38PM +, Martin Wilck wrote: > On Wed, 2020-06-17 at 19:24 -0500, Benjamin Marzinski wrote: > > If a multipath device is removed during, or immediately before the > > call > > to check_path(), multipathd can behave incorrectly. A missing &g

Re: [dm-devel] [PATCH 1/7] libmultipath: change do_get_info returns

2020-06-18 Thread Benjamin Marzinski
On Thu, Jun 18, 2020 at 03:27:22PM +, Martin Wilck wrote: > On Wed, 2020-06-17 at 19:24 -0500, Benjamin Marzinski wrote: > > Make do_get_info() differentiate between dm failures and missing > > devices, and update callers to retain their current behavior. Also, > &g

Re: [dm-devel] [PATCH 7/7] multipath: add option to skip multipathd delegation

2020-06-18 Thread Benjamin Marzinski
On Thu, Jun 18, 2020 at 08:44:10PM +, Martin Wilck wrote: > On Wed, 2020-06-17 at 19:24 -0500, Benjamin Marzinski wrote: > > Add the -D option to allow users to skip delegating commands to > > multipathd. > > > > Signed-off-by: Benjamin Marzinski > > --

Re: [dm-devel] [PATCH 4/7] multipathd: add "del maps" multipathd command

2020-06-18 Thread Benjamin Marzinski
On Thu, Jun 18, 2020 at 08:37:20PM +, Martin Wilck wrote: > On Wed, 2020-06-17 at 19:24 -0500, Benjamin Marzinski wrote: > > This will flush all multipath devices. > > > > Signed-off-by: Benjamin Marzinski > > --- > > libmultipath/devmapper.c | 7

Re: [dm-devel] [PATCH 0/7] Fix muitpath/multipathd flush issue

2020-06-18 Thread Benjamin Marzinski
On Thu, Jun 18, 2020 at 08:06:53PM +, Martin Wilck wrote: > On Thu, 2020-06-18 at 13:04 -0500, Benjamin Marzinski wrote: > > On Thu, Jun 18, 2020 at 09:00:49AM +, Martin Wilck wrote: > > > > > > With queue_if_no_paths, there could be outstanding IO even i

Re: [dm-devel] [PATCH 0/7] Fix muitpath/multipathd flush issue

2020-06-18 Thread Benjamin Marzinski
On Thu, Jun 18, 2020 at 09:00:49AM +, Martin Wilck wrote: > On Wed, 2020-06-17 at 19:24 -0500, Benjamin Marzinski wrote: > > > > One source of complexity in these patches is that multipath suspends > > the > > device with flushing before removing it, while multipath

[dm-devel] [PATCH 6/7] multipath: delegate flushing maps to multipathd

2020-06-17 Thread Benjamin Marzinski
itself. Signed-off-by: Benjamin Marzinski --- multipath/main.c | 14 ++ 1 file changed, 14 insertions(+) diff --git a/multipath/main.c b/multipath/main.c index 101fd656..6a24e483 100644 --- a/multipath/main.c +++ b/multipath/main.c @@ -820,6 +820,20 @@ int delegate_to_multipathd(enum

[dm-devel] [PATCH 7/7] multipath: add option to skip multipathd delegation

2020-06-17 Thread Benjamin Marzinski
Add the -D option to allow users to skip delegating commands to multipathd. Signed-off-by: Benjamin Marzinski --- libmultipath/config.h | 1 + multipath/main.c | 15 +++ multipath/multipath.8 | 16 +++- 3 files changed, 23 insertions(+), 9 deletions(-) diff --git

[dm-devel] [PATCH 0/7] Fix muitpath/multipathd flush issue

2020-06-17 Thread Benjamin Marzinski
ce is open, I don't see the benefit to doing this anymore. Removing it would allow multipathd and multipath to use the same code to remove maps. Any thoughts? Benjamin Marzinski (7): libmultipath: change do_get_info returns multipathd: fix check_path errors with removed map libmultipath: make

[dm-devel] [PATCH 1/7] libmultipath: change do_get_info returns

2020-06-17 Thread Benjamin Marzinski
Make do_get_info() differentiate between dm failures and missing devices, and update callers to retain their current behavior. Also, rename it and make it external. These changes will be used by future commits. Signed-off-by: Benjamin Marzinski --- libmultipath/devmapper.c | 29

[dm-devel] [PATCH v2 2/3] libmultipath: fix parser issue with comments in strings

2020-06-09 Thread Benjamin Marzinski
If a quoted string starts with '#' or '!', the parser will stop parsing the line, thinking that it's a comment. It should only be checking for comments outside of quoted strings. Fixed this and added unit tests to verify it. Signed-off-by: Benjamin Marzinski --- libmultipath/parser.c | 4

[dm-devel] [PATCH v2 1/3] libmultipath: remove _blacklist_exceptions functions

2020-06-09 Thread Benjamin Marzinski
_blacklist_exceptions() and _blacklist_exceptions_device() are exactly the same as _blacklist() and _blacklist_device(), so remove them, and give the remaining functions to a more general name. Signed-off-by: Benjamin Marzinski --- libmultipath/blacklist.c | 62

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