Re: [dm-devel] [PATCH v2 3/9] libmultipath: alua: try to retrieve inquiry data from sysfs

2019-03-18 Thread Martin Wilck
On Mon, 2019-03-18 at 08:08 +0100, Hannes Reinecke wrote: > On 3/15/19 6:19 PM, Martin Wilck wrote: > > This can avoid IO while configuring the path prioritizer. > > The alua prioritizer avoids reading from sysfs for a reason > > (see commit 7e2f46d3), but this applies only to

Re: [dm-devel] [PATCH v2 8/9] libmultipath: check_rdac(): pre-check in hwtable

2019-03-18 Thread Martin Wilck
On Mon, 2019-03-18 at 08:10 +0100, Hannes Reinecke wrote: > On 3/15/19 6:19 PM, Martin Wilck wrote: > > Currently check_rdac() always runs an SG_IO for VPD 0xc9 to check > > if the storage supports RDAC. This is an extra IO, and may cause > > annoying error messages on the

Re: [dm-devel] [PATCH v2 8/9] libmultipath: check_rdac(): pre-check in hwtable

2019-03-18 Thread Martin Wilck
On Mon, 2019-03-18 at 10:52 +0100, Martin Wilck wrote: > On Mon, 2019-03-18 at 08:10 +0100, Hannes Reinecke w > > *origin? dummy for do_set_from_hwe()? > > What funky interface is that? > > > > Please redesign do_set_from_hwe() so as _not_ to require 'magic

[dm-devel] [PATCH v3 00/10] multipath-tools: avoid I/O during uevent processing

2019-03-18 Thread Martin Wilck
do_set_from_hwe() with statement expression" (Hannes), renumber subsequent patches accordingly. - 9/10: cleanup ugly macro usage; do retrieve VPD for "unknown" SCSI storage devices Changes v1->v2: - 6/9: remove one remaining direct access to pp->tpgs - 9/

[dm-devel] [PATCH v3 02/10] libmultipath: alua: make API more consistent

2019-03-18 Thread Martin Wilck
Let all alua functions take "const struct path *" as first argument. Signed-off-by: Martin Wilck --- libmultipath/discovery.c | 4 ++-- libmultipath/prioritizers/alua.c | 4 ++-- libmultipath/prioritizers/alua_rtpg.c | 28 +-- li

[dm-devel] [PATCH v3 04/10] libmultipath: constify sysfs_get_timeout()

2019-03-18 Thread Martin Wilck
Signed-off-by: Martin Wilck --- libmultipath/discovery.c | 2 +- libmultipath/discovery.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/libmultipath/discovery.c b/libmultipath/discovery.c index 6b4a420b..270dedc9 100644 --- a/libmultipath/discovery.c +++ b/libmultipath

[dm-devel] [PATCH v3 08/10] libmultipath: tidy up do_set_from_hwe() with statement expression

2019-03-18 Thread Martin Wilck
Hannes Reinecke Signed-off-by: Martin Wilck --- libmultipath/propsel.c | 22 +++--- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/libmultipath/propsel.c b/libmultipath/propsel.c index 27474f05..caf55b68 100644 --- a/libmultipath/propsel.c +++ b/libmultipath/propsel.c @

[dm-devel] [PATCH v3 07/10] libmultipath: don't link alua_rtpg.o twice

2019-03-18 Thread Martin Wilck
We link this already to libmultipath.so. Therefore, no need to link ti to libprioalua.so, too. Signed-off-by: Martin Wilck --- libmultipath/prioritizers/Makefile | 3 --- 1 file changed, 3 deletions(-) diff --git a/libmultipath/prioritizers/Makefile b/libmultipath/prioritizers/Makefile index

[dm-devel] [PATCH v3 05/10] libmultipath: detect_alua(): use system timeout

2019-03-18 Thread Martin Wilck
This is not the path checker - we don't need to use the configured checker timeout here. This makes it possible to call this function without a current (struct config *). Signed-off-by: Martin Wilck --- libmultipath/discovery.c | 9 ++--- 1 file changed, 6 insertions(+), 3 dele

[dm-devel] [PATCH v3 03/10] libmultipath: alua: try to retrieve inquiry data from sysfs

2019-03-18 Thread Martin Wilck
This can avoid IO while configuring the path prioritizer. The alua prioritizer avoids reading from sysfs for a reason (see commit 7e2f46d3), but this applies only to RTPG / STPG, not to INQUIRY calls. Cc: steve.schrem...@netapp.com Cc: NetApp RDAC team Cc: Hannes Reinecke Signed-off-by: Martin

[dm-devel] [PATCH v3 06/10] libmultipath: lazy tpgs probing

2019-03-18 Thread Martin Wilck
ect_prio(), in the case where the alua checker was statically configured, rather then calling into the alua code directly, use get_tpgs(), which does all the proper error checking, and fall back to const prio if it fails. Signed-off-by: Martin Wilck --- libmultipath/discovery.c | 10 +++

[dm-devel] [PATCH v3 10/10] libmultipath: hwtable: add Lenovo DE series

2019-03-18 Thread Martin Wilck
I got this from Steven. Cc: steve.schrem...@netapp.com Cc: NetApp RDAC team Cc: xose.vazq...@gmail.com Signed-off-by: Martin Wilck --- libmultipath/hwtable.c | 20 1 file changed, 20 insertions(+) diff --git a/libmultipath/hwtable.c b/libmultipath/hwtable.c index d3a8d9ba

[dm-devel] [PATCH v3 01/10] libmultipath: add sysfs_get_inquiry()

2019-03-18 Thread Martin Wilck
Provide a utility function to retrieve inquiry data from sysfs, like we do for VPDs. Signed-off-by: Martin Wilck --- libmultipath/discovery.c | 23 ++- libmultipath/discovery.h | 6 -- 2 files changed, 22 insertions(+), 7 deletions(-) diff --git a/libmultipath

[dm-devel] [PATCH v3 09/10] libmultipath: check_rdac(): pre-check in hwtable

2019-03-18 Thread Martin Wilck
"rdac". For "unkown" devices with no checker configured in either the hwtable or multipath.conf, the VPD call will be tried. Cc: steve.schrem...@netapp.com Cc: NetApp RDAC team Cc: Hannes Reinecke Signed-off-by: Martin Wilck --- libmultipath/propsel.c | 5 + 1 file c

[dm-devel] [PATCH 1/3] multipathd: handle changed wwids by removal and addition

2019-03-18 Thread Martin Wilck
by the "missing udev" logic. Signed-off-by: Martin Wilck --- multipathd/main.c | 71 +-- 1 file changed, 38 insertions(+), 33 deletions(-) diff --git a/multipathd/main.c b/multipathd/main.c index fb520b64..bd26209d 100644 --- a/multipathd/

[dm-devel] [PATCH 2/3] multipathd: remove "wwid_changed" path attribute

2019-03-18 Thread Martin Wilck
This is now not needed any more. Signed-off-by: Martin Wilck --- libmultipath/structs.h | 1 - multipathd/main.c | 6 -- 2 files changed, 7 deletions(-) diff --git a/libmultipath/structs.h b/libmultipath/structs.h index b794b0dc..7879d763 100644 --- a/libmultipath/structs.h +++ b

[dm-devel] [PATCH 0/3] New approach at handling changed WWIDs

2019-03-18 Thread Martin Wilck
nd depend on udev exclusively for WWID generation. I haven't included this in the current patch set in order not to make it too controversial. The only purpose for the fallback logic that I could see is to provide a configuration option to force multipathd to _always_ determine the WWID by itsel

[dm-devel] [PATCH 3/3] multipathd: ignore "disable_changed_wwids"

2019-03-18 Thread Martin Wilck
This option has no effect any more. Signed-off-by: Martin Wilck --- libmultipath/config.c | 1 - libmultipath/config.h | 1 - libmultipath/dict.c| 18 +++--- multipath/multipath.conf.5 | 8 ++-- 4 files changed, 17 insertions(+), 11 deletions(-) diff --git

Re: [dm-devel] [PATCH 0/3] New approach at handling changed WWIDs

2019-03-19 Thread Martin Wilck
On Tue, 2019-03-19 at 12:11 -0500, Benjamin Marzinski wrote: > On Mon, Mar 18, 2019 at 01:12:32PM +0100, Martin Wilck wrote: > > Hi Ben, hi Christophe, > > > > after reviewing Ben's last patch set, I've been pondering over the > > handling of changed WWIDs,

Re: [dm-devel] [PATCH v2 11/12] libmultipath: add get_uid fallback code for NVMe devices

2019-03-20 Thread Martin Wilck
On Tue, 2019-03-19 at 12:15 -0500, Benjamin Marzinski wrote: > On Fri, Mar 15, 2019 at 12:49:41PM +0100, Martin Wilck wrote: > > On Fri, 2019-03-08 at 17:12 -0600, Benjamin Marzinski wrote: > > > If multipath can't get the uid for NVMe devices from udev, it can > >

Re: [dm-devel] [PATCH 0/3] New approach at handling changed WWIDs

2019-03-20 Thread Martin Wilck
On Tue, 2019-03-19 at 19:44 +0100, Martin Wilck wrote: > On Tue, 2019-03-19 at 12:11 -0500, Benjamin Marzinski wrote: > > On Mon, Mar 18, 2019 at 01:12:32PM +0100, Martin Wilck wrote: > > > > > > Note also that if a "reconfigure" was carried out in the prese

Re: [dm-devel] [PATCH 0/3] New approach at handling changed WWIDs

2019-03-22 Thread Martin Wilck
ed if we get a non-zero ID_SERIAL and at the same time none of the required properties, e.g. ID_WWN. IMO, if this is the case, we can be certain that scsi_id did *not* fail - after all, it was able to obtain ID_SERIAL. OTOH, if neither ID_SERIAL nor ID_WWN is set, failure to access the device is likely. Thus the solution here is simple: We should apply "blacklisting by missing property" *only* if ID_SERIAL is set, but ID_WWN is not. Martin -- Dr. Martin Wilck , Tel. +49 (0)911 74053 2107 SUSE Linux GmbH, GF: Felix Imendörffer, Jane Smithard, Graham Norton HRB 21284 (AG Nürnberg) -- dm-devel mailing list dm-devel@redhat.com https://www.redhat.com/mailman/listinfo/dm-devel

Re: [dm-devel] [PATCH 0/3] New approach at handling changed WWIDs

2019-03-26 Thread Martin Wilck
S device flag if they do support the DI VPD. OPEN-V devices are a notorious example. But meanwhile the blist flags are in place for them. Regards Martin -- Dr. Martin Wilck , Tel. +49 (0)911 74053 2107 SUSE Linux GmbH, GF: Felix Imendörffer, Jane Smithard, Graham Norton HRB 21284 (AG Nürnberg) -- dm-devel mailing list dm-devel@redhat.com https://www.redhat.com/mailman/listinfo/dm-devel

Re: [dm-devel] [PATCH resend] multipath-tools: document why dev_loss_tmo is set to infinity for HPE 3PAR

2019-03-29 Thread Martin Wilck
.dev_loss = MAX_DEV_LOSS_TMO, > }, > { I'm not quite getting the benefit of adding this comment without further explanation what Peer Persistence is. Also, IMO, setting dev_loss_tmo to a higher value than the default (contrary to lowering it) doesn't r

Re: [dm-devel] least-pending multipath path selector WAS (9/14/14 !!!!): Re: Powerpath vs dm-multipath - two points of FUD?

2019-04-01 Thread Martin Wilck
it's used much, if at all. Even if the "least pending" selector was still needed, the patch would need updating for current upstream, to accomodate the changes from 9659f811446a "dm mpath: push path selector locking down to path selectors", and possibly other changes in th

Re: [dm-devel] [PATCH] scsi: add new RDAC LENOVO/DE_Series device

2019-04-01 Thread Martin Wilck
On Sat, 2019-03-30 at 15:43 +0100, Xose Vazquez Perez wrote: > Blacklist "Universal Xport" LUN, it's used for in-band storage array > management. > And add it to the rdac dh family. > > Cc: Martin Wilck > Cc: Hannes Reinecke > Cc: NetApp RDAC team >

Re: [dm-devel] [PATCH v3 10/17] multipath.conf: add missing options to man page

2019-04-01 Thread Martin Wilck
On Sat, 2019-03-30 at 01:05 -0500, Benjamin Marzinski wrote: > Signed-off-by: Benjamin Marzinski > --- Reviewed-by: Martin Wilck -- dm-devel mailing list dm-devel@redhat.com https://www.redhat.com/mailman/listinfo/dm-devel

Re: [dm-devel] [PATCH v3 12/17] libmulitpath: cleanup uid_fallback code

2019-04-01 Thread Martin Wilck
condlog(1, "%s: failed to get sysfs > uid: %s", > - pp->dev, strerror(-len)); > - len = get_vpd_sgio(pp->fd, 0x83, pp- > >wwid, > + ssize_t len = -1; > + > + if (pp->bus

Re: [dm-devel] [PATCH v3 13/17] multipathd: handle changed wwids by removal and addition

2019-04-01 Thread Martin Wilck
and > remembering the "changed WWID" state, this patch simply removes and > re-adds the path. > > This is patch is heavily based on the previous patch of the same name > by Martin Wilck. > > Signed-off-by: Benjamin Marzinski > --- Reviewed-by: Martin Wil

Re: [dm-devel] [PATCH v3 16/17] multipathd: Don't use fallback code after getting wwid

2019-04-01 Thread Martin Wilck
+1846,9 @@ get_uid (struct path * pp, int path_state, > struct udev_device *udev) > len = get_vpd_uid(pp); > origin = "sysfs"; On the premise that "udev rules", maybe we should also remove the above code, which is nothing but yet ano

Re: [dm-devel] [PATCH v3 17/17] libmultipath: silence dm_is_mpath error messages

2019-04-01 Thread Martin Wilck
> the default verbosity. > > Signed-off-by: Benjamin Marzinski > --- Reviewed-by: Martin Wilck -- Dr. Martin Wilck , Tel. +49 (0)911 74053 2107 SUSE Linux GmbH, GF: Felix Imendörffer, Jane Smithard, Graham Norton HRB 21284 (AG Nürnberg) -- dm-devel mailing list dm-devel@redha

Re: [dm-devel] [PATCH v3 07/17] multipathd: ignore failed wwid recheck

2019-04-01 Thread Martin Wilck
t; return > value if it doesn't attempt to fallback. > > Signed-off-by: Benjamin Marzinski Reviewed-by: Martin Wilck -- Dr. Martin Wilck , Tel. +49 (0)911 74053 2107 SUSE Linux GmbH, GF: Felix Imendörffer, Jane Smithard, Graham Norton HRB 21284 (AG Nürnberg) -- dm-devel mailing list dm-devel@redhat.com https://www.redhat.com/mailman/listinfo/dm-devel

Re: [dm-devel] [PATCH] Fix systemd version detection

2019-04-04 Thread Martin Wilck
Hi Ben, On Thu, 2019-04-04 at 17:03 -0500, Benjamin Marzinski wrote: > From: Igor Gnatenko > > Reviewed-by: Benjamin Marzinski > Signed-off-by: Igor Gnatenko I'd submitted a different patch last month: "multipath-tools: Build: properly parse systemd's version" https://www.redhat.com/archives

[dm-devel] [PATCH RESEND 0/3] Possibly lost multipath-tools patches

2019-04-11 Thread Martin Wilck
tipathd: fix daemon not really shutdown Dominique Leuenberger (1): multipath-tools: Build: properly parse systemd's version Martin Wilck (1): multipathd: protect all access to running_state Makefile.inc | 9 +-- multipathd/main.c | 60 ++---

[dm-devel] [PATCH RESEND 3/3] multipathd: protect all access to running_state

2019-04-11 Thread Martin Wilck
ble are protected by config_lock. The patch also replaces "if" with "while" in several places where the code was supposed to wait until a certain state was reached. It's important that DAEMON_SHUTDOWN terminates all loops of this kind. Reviewed-by: Benjamin Marzinski Signed-off-

[dm-devel] [PATCH RESEND 1/3] multipath-tools: Build: properly parse systemd's version

2019-04-11 Thread Martin Wilck
r "-DUSE_SYSTEMD=241 (241)" results in shell errors. Try to retrieve the version from pkg-config instead, and if that fails, discard anything after the first number in "systemctl --version" output. Acked-by: Benjamin Marzinski Acked-by: Xose Vazquez Perez Signed-off-by: Martin W

[dm-devel] [PATCH RESEND 2/3] multipathd: fix daemon not really shutdown

2019-04-11 Thread Martin Wilck
ove this really happened, so we need add judgement here too. (2) [this part removed by mwilck] Signed-off-by: Chongyun Wu Signed-off-by: Martin Wilck Reviewed-by: Benjamin Marzinski --- multipathd/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/multipathd/main.c b/mu

[dm-devel] [PATCH 2/4] Revert "Set priority to '0' for PATH_BLOCKED or PATH_DOWN"

2019-04-11 Thread Martin Wilck
h are not UP or GHOST are ignored anyway, so this change will not cause changes wrt PG priorities or PG ordering. Signed-off-by: Martin Wilck Cc: Hannes Reinecke --- libmultipath/discovery.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/libmultipath/discovery.c b/libmultipath/discovery.c

[dm-devel] [PATCH 3/4] libmultipath: ana prioritizer: decrease log level

2019-04-11 Thread Martin Wilck
o only printed at level 4. Decrease the verbosity of this message. Signed-off-by: Martin Wilck --- libmultipath/prioritizers/ana.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libmultipath/prioritizers/ana.c b/libmultipath/prioritizers/ana.c index 990d935f..2673d9d9 100644 ---

[dm-devel] [PATCH 4/4] libmultipath: get_prio(): don't reset prio for inaccessible paths

2019-04-11 Thread Martin Wilck
Keep the previous behavior for the case where getting the priority fails although the path is apparently healthy. This is presumably a very rare condition, in which it seems actually wrong to preserve the old prio value. Signed-off-by: Martin Wilck --- libmultipath/discovery.c | 13 +++-- 1 file

[dm-devel] [PATCH 1/4] libmultipath: group_by_prio: fix signedness bug

2019-04-11 Thread Martin Wilck
pp->priority can be negative, so we we shouldn't compare it with an unsigned int. Signed-off-by: Martin Wilck --- libmultipath/pgpolicies.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libmultipath/pgpolicies.c b/libmultipath/pgpolicies.c index ac2596ad..660768a

[dm-devel] [PATCH 0/4] multipath-tools: prio handling for offline paths

2019-04-11 Thread Martin Wilck
last accessible. Martin Wilck (4): libmultipath: group_by_prio: fix signedness bug Revert "Set priority to '0' for PATH_BLOCKED or PATH_DOWN" libmultipath: ana prioritizer: decrease log level libmultipath: get_prio(): don't reset prio for inaccessible path

Re: [dm-devel] [PATCH RESEND 0/3] Possibly lost multipath-tools patches

2019-04-11 Thread Martin Wilck
Hi Christophe, On Thu, 2019-04-11 at 12:27 +0200, Martin Wilck wrote: > lest they be forgotten, the patches in this series have been > previously > submitted to dm-devel, and got positive review. Please apply at your > convenience. Ben's latest series "[PATCH v3 00/17] Mi

Re: [dm-devel] [RFC PATCH] multipath: check on multipathd without starting it

2019-04-18 Thread Martin Wilck
space" feature in multipath. One of our customers worked around the problem by adding an After=systemd-udev-settle.service to multipathd.socket, too. That way socket activation doesn't happen; it seems to "work" too, but it wouldn't be my preferred solution. > Signed-off

Re: [dm-devel] [RFC PATCH] multipath: check on multipathd without starting it

2019-04-23 Thread Martin Wilck
Hi Ben and Christophe, On Thu, 2019-04-18 at 22:30 +0200, Martin Wilck wrote: > Hi Ben, > > > Signed-off-by: Benjamin Marzinski > > The patch looks good to me. > > Reviewed-by: Martin Wilck After the holidays, I analyzed this once more, and I've come up with

[dm-devel] [PATCH] multipath -u: test socket connection in non-blocking mode

2019-04-23 Thread Martin Wilck
Since commit d7188fcd "multipathd: start daemon after udev trigger", multipathd startup is delayed during boot until after "udev settle" terminates. But "multipath -u" is run by udev workers for storage devices, and attempts to connect to the multipathd socket. This causes a start job for multipath

Re: [dm-devel] [PATCH] multipath -u: test socket connection in non-blocking mode

2019-04-24 Thread Martin Wilck
On Wed, 2019-04-24 at 07:48 +0200, Hannes Reinecke wrote: > On 4/23/19 9:32 PM, Martin Wilck wrote: > > > > +/* > > + * connect to a unix domain socket > > + */ > > +int mpath_connect(void) > > +{ > > + int fd = __mpath_connect(0); > &g

[dm-devel] [PATCH v2] multipath -u: test socket connection in non-blocking mode

2019-04-24 Thread Martin Wilck
connect() and interpret the errno appropriately. This patch reverts most of the changes from commit 8cdf6661 "multipath: check on multipathd without starting it". Instead, "multipath -u" does access the socket and start multipath again (which is what we want IMO), but it is

Re: [dm-devel] [PATCH v2] dm mpath: fix missing call of path selector type->end_io

2019-04-24 Thread Martin Wilck
_info to ->release_clone_rq() for requeue > path, > and pass NULL for the others path. > > Fixes: 396eaf21ee17 ("blk-mq: improve DM's blk-mq IO merging via > blk_insert_cloned_request feedback") > Cc: Ming Lei > Cc: Martin Wilck > Cc: Mikulas Patocka &

Re: [dm-devel] [PATCH v2] multipath -u: test socket connection in non-blocking mode

2019-04-25 Thread Martin Wilck
On Wed, 2019-04-24 at 11:07 +0200, Martin Wilck wrote: > Since commit d7188fcd "multipathd: start daemon after udev trigger", > multipathd startup is delayed during boot until after "udev settle" > terminates. But "multipath -u" is run by udev workers f

Re: [dm-devel] [PATCH] dm mpath: fix memory leak for attached_handler_name

2019-04-29 Thread Martin Wilck
On Sat, 2019-04-27 at 18:54 +0800, Yufen Yu wrote: > If multipath does not set flag MPATHF_RETAIN_ATTACHED_HW_HANDLER, > parse_path() would forget to free attached_handler_name when > successfully exit, resulting in memory leak. I believe this should rather be done in parse_path(), as setup_scsi_d

[dm-devel] [PATCH] dm mpath: parse_path: always free attached_handler_name

2019-04-29 Thread Martin Wilck
r flag is not set on the map. As setup_scsi_sh properly "steals" the pointer by nullifying it, freeing it unconditionally in parse_path() is safe. Fixes: b592211c33f7 "dm mpath: fix attached_handler_name leak and dangling hw_handler_name pointer" Reported-by: Yufen Yu Signed-

Re: [dm-devel] [PATCH v2] dm mpath: fix missing call of path selector type->end_io

2019-04-29 Thread Martin Wilck
ng, it doesn't get bogged down with passing > flags > (and overloading their use with unnatural new meanings). Please let > me > know if you see any issues: > > https://git.kernel.org/pub/scm/linux/kernel/git/device-mapper/linux-dm.git/commit/?h=dm-5.2&id=5de719e3d01b4abe0de0d7b857148a880ff2a90b Nice and simple. Looks good to me. Reviewed-by: Martin Wilck -- dm-devel mailing list dm-devel@redhat.com https://www.redhat.com/mailman/listinfo/dm-devel

[dm-devel] [PATCH] multipathd: fix client response for socket activation

2019-04-30 Thread Martin Wilck
r getting the expected response for other commands. To avoid this side effect, the client handling would need to be rewritten such that the uxlsnr thread would have a means to "know" which commands require the configuration stage to complete and which do not. Signed-off-by: Martin Wil

[dm-devel] [PATCH v2] multipathd: fix client response for socket activation

2019-04-30 Thread Martin Wilck
r getting the expected response for other commands. To avoid this side effect, the client handling would need to be rewritten such that the uxlsnr thread would have a means to "know" which commands require the configuration stage to complete and which do not. v2: Removed an unrelated,

Re: [dm-devel] [PATCH] multipath-tools: document missing mpathpersist flags in help output

2019-05-10 Thread Martin Wilck
On Thu, 2019-05-02 at 23:49 +0200, Xose Vazquez Perez wrote: > Cc: Christophe Varoqui > Cc: DM-DEVEL ML > Signed-off-by: Xose Vazquez Perez > --- > mpathpersist/main.c | 17 ++--- > 1 file changed, 10 insertions(+), 7 deletions(-) Reviewed-by: Martin Wilck -

Re: [dm-devel] [PATCH] multipath-tools: document missing multipath flags in help output

2019-05-10 Thread Martin Wilck
On Thu, 2019-05-02 at 21:24 +0200, Xose Vazquez Perez wrote: > Cc: Christophe Varoqui > Cc: DM-DEVEL ML > Signed-off-by: Xose Vazquez Perez > --- > multipath/main.c | 35 ++- > 1 file changed, 22 insertions(+), 13 deletions(-) Reviewed-by: Mar

Re: [dm-devel] [PATCH] multipath-tools: document missing multipathd option at man page

2019-05-10 Thread Martin Wilck
+++ > 1 file changed, 7 insertions(+) Reviewed-by: Martin Wilck -- dm-devel mailing list dm-devel@redhat.com https://www.redhat.com/mailman/listinfo/dm-devel

Re: [dm-devel] [PATCH v2] multipath -u: test socket connection in non-blocking mode

2019-05-15 Thread Martin Wilck
On Mon, 2019-04-29 at 16:38 -0500, Benjamin Marzinski wrote: > On Thu, Apr 25, 2019 at 09:33:03PM +0200, Martin Wilck wrote: > > > > @Ben, I'd be grateful if you could try it (or have the user try it) > > in your problem case as well. > > Unfortunately, I don'

[dm-devel] [PATCH] libmultipath: get_prio(): really don't reset prio for inaccessible paths

2019-05-16 Thread Martin Wilck
As pointed out by Ben Marzinski, my previous patch ebbb56f2 doesn't do what it pretends to do. Fixes: ebbb56f2 "libmultipath: get_prio(): don't reset prio for inaccessible paths" --- libmultipath/discovery.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/libmultipath/dis

Re: [dm-devel] [PATCH 1/4] libmultipath: handle clock_gettime failures in tur checker

2019-05-17 Thread Martin Wilck
On Fri, 2019-05-17 at 11:14 -0500, Benjamin Marzinski wrote: > If clock_gettime() fails, and multipathd can't figure out when it > should > time out, it should just default to assuming that it has already > timed > out. Found by coverity. > > Signed-off-by: Benjamin Marzinski > --- > libmultipat

Re: [dm-devel] [PATCH 0/4] Coverity fixes

2019-05-17 Thread Martin Wilck
On Fri, 2019-05-17 at 11:14 -0500, Benjamin Marzinski wrote: > These are fixes to some issues that coverity pointed out. > > Benjamin Marzinski (4): > libmultipath: handle clock_gettime failures in tur checker > kpartx: fail if dup() of dasd file descriptor fails > multipathd: fix REALLOC_RE

[dm-devel] [RFC PATCH 5/7] libmpathpersist: factor out initialization and teardown

2019-05-17 Thread Martin Wilck
mpath_presistent_reserve_{in,out} share a lot of common code for initial data structure initialization (discovery) and teardown. Factor this code out into mpath_persistent_reserve_init_vecs() (global data structure initialization), mpath_persistent_reserve_free_vecs (global teardown) and mpath_get_

[dm-devel] [RFC PATCH 7/7] libmpathpersist: don't bother with priorities

2019-05-17 Thread Martin Wilck
We send our PR commands to every active path, regardless of priority. Thus we can save the effort to obtain priorities. --- libmpathpersist/mpath_persist.c | 7 --- 1 file changed, 7 deletions(-) diff --git a/libmpathpersist/mpath_persist.c b/libmpathpersist/mpath_persist.c index ce72da67..59

[dm-devel] [RFC PATCH 3/7] mpathpersist: no need to treat error close() as fatal

2019-05-17 Thread Martin Wilck
Simplify code a bit. --- mpathpersist/main.c | 11 ++- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/mpathpersist/main.c b/mpathpersist/main.c index c1a6d3c8..b204647f 100644 --- a/mpathpersist/main.c +++ b/mpathpersist/main.c @@ -154,7 +154,7 @@ static int do_batch_file(co

[dm-devel] [RFC PATCH 0/7] speeding up mpathpersist

2019-05-17 Thread Martin Wilck
n - allow multiple PR commands in a single run using "batch files", without re-discovering everything between PR commands - avoid looking at priorities I've done some basic testing and it seems to work. It remains to be seen what the effect on performance really is. Regard

[dm-devel] [RFC PATCH 2/7] mpathpersist: add option --batch-file (-f)

2019-05-17 Thread Martin Wilck
Add the option --batch-file (-f) to mpathpersist. The option argument is a text file that is parsed line-by-line. Every line of the file is interpreted as an additional input line for mpathpersist. The initial "mpathpersist" on each line is optional. The '#' character denotes a comment. '#' is only

[dm-devel] [RFC PATCH 6/7] mpathpersist: initialize data structures only once

2019-05-17 Thread Martin Wilck
We now have the possibility to run several PR commands in a single mpathpersist invocation. Run initialization / discovery and teardown only once at program invocation / exit. --- mpathpersist/main.c | 11 --- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/mpathpersist/main.

[dm-devel] [RFC PATCH 4/7] libmpathpersist: updatepaths: deal with missing pp->udev

2019-05-17 Thread Martin Wilck
We will change the data structure initialization to a lazy approach, where pp->udev isn't necessarily initialized when get_mpvec() is called. Deal with it. --- libmpathpersist/mpath_persist.c | 12 1 file changed, 12 insertions(+) diff --git a/libmpathpersist/mpath_persist.c b/libmpa

[dm-devel] [RFC PATCH 1/7] mpathpersist: call usage() just once on return

2019-05-17 Thread Martin Wilck
This simplifies further changes. --- mpathpersist/main.c | 11 ++- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/mpathpersist/main.c b/mpathpersist/main.c index 10cba452..94e89c13 100644 --- a/mpathpersist/main.c +++ b/mpathpersist/main.c @@ -265,7 +265,6 @@ int main (int a

[dm-devel] [PATCH] multipath-tools (coverity): assert availability of CLOCK_MONOTONIC

2019-05-20 Thread Martin Wilck
ity. Not doing this for libdmmp here, as it has it's own error checking and doesn't use headers from libmultipath. Signed-off-by: Martin Wilck --- libmultipath/checkers/tur.c | 6 +++--- libmultipath/time-util.c| 8 libmultipath/time-util.h| 1 + multipa

[dm-devel] [PATCH] mpathpersist.8: fix examples in man page

2019-05-20 Thread Martin Wilck
tering the current key, and the CLEAR service action. Fix formatting with longer text in the description lines (the .TP formatting would produce bad results if the first line needs to be broken). Signed-off-by: Martin Wilck --- mpathpersist/mpathpersist.8 | 43 +--

Re: [dm-devel] [PATCH] multipath-tools (coverity): assert availability of CLOCK_MONOTONIC

2019-05-20 Thread Martin Wilck
On Mon, 2019-05-20 at 22:09 +0200, Bart Van Assche wrote: > On 5/20/19 6:30 PM, Martin Wilck wrote: > > +void get_monotonic_time(struct timespec *res) > > +{ > > + struct timespec ts; > > + > > + assert(clock_gettime(CLOCK_MONOTONIC, &ts) == 0); >

[dm-devel] [PATCH v2] multipath-tools (coverity): assert availability of CLOCK_MONOTONIC

2019-05-20 Thread Martin Wilck
ity. Not doing this for libdmmp here, as it has it's own error checking and doesn't use headers from libmultipath. v2: Fix mistake that with -DNDEBUG, clock_gettime wouldn't be called at all (Bart van Assche). Signed-off-by: Martin Wilck --- libmultipath/checkers/tur.c | 6 ++

Re: [dm-devel] [PATCH] libmultipath: make vector_foreach_slot_backwards work as expected

2019-05-27 Thread Martin Wilck
ntry counting from 1, not 0. > > Signed-off-by: Benjamin Marzinski > --- > libmultipath/vector.h | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > Reviewed-by: Martin Wilck Let's add that there was only one caller that actually used "i"("multipath -W&quo

[dm-devel] [PATCH v2 0/9] speeding up mpathpersist

2019-05-27 Thread Martin Wilck
pathpersist.8: fix examples in man page" which I'd sent separately before Martin Wilck (9): mpathpersist: call usage() just once on return mpathpersist: add option --batch-file (-f) mpathpersist: no need to treat error close() as fatal libmpathpersist: updatepaths: deal with mi

[dm-devel] [PATCH v2 5/9] libmpathpersist: factor out initialization and teardown

2019-05-27 Thread Martin Wilck
ialization procedure. In get_mpvec(), we don't delete non-matching maps any more, because we way want to act on them later on. Signed-off-by: Martin Wilck --- libmpathpersist/mpath_persist.c | 231 ++-- libmpathpersist/mpath_persist.h | 40 ++ 2 files changed,

[dm-devel] [PATCH v2 7/9] libmpathpersist: don't bother with priorities

2019-05-27 Thread Martin Wilck
We send our PR commands to every active path, regardless of priority. Thus we can save the effort to obtain priorities. Signed-off-by: Martin Wilck --- libmpathpersist/mpath_persist.c | 7 --- 1 file changed, 7 deletions(-) diff --git a/libmpathpersist/mpath_persist.c b/libmpathpersist

[dm-devel] [PATCH v2 1/9] mpathpersist: call usage() just once on return

2019-05-27 Thread Martin Wilck
This simplifies further changes. Signed-off-by: Martin Wilck --- mpathpersist/main.c | 11 ++- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/mpathpersist/main.c b/mpathpersist/main.c index 10cba452..94e89c13 100644 --- a/mpathpersist/main.c +++ b/mpathpersist/main.c

[dm-devel] [PATCH v2 9/9] mpathpersist.8: add documentation for --batch-file (-f)

2019-05-27 Thread Martin Wilck
Signed-off-by: Martin Wilck --- mpathpersist/mpathpersist.8 | 78 - 1 file changed, 77 insertions(+), 1 deletion(-) diff --git a/mpathpersist/mpathpersist.8 b/mpathpersist/mpathpersist.8 index cd602e40..882043ae 100644 --- a/mpathpersist/mpathpersist.8 +++ b

[dm-devel] [PATCH v2 8/9] mpathpersist.8: fix examples in man page

2019-05-27 Thread Martin Wilck
tering the current key, and the CLEAR service action. Fix formatting with longer text in the description lines (the .TP formatting would produce bad results if the first line needs to be broken). Signed-off-by: Martin Wilck --- mpathpersist/mpathpersist.8 | 43 +--

[dm-devel] [PATCH v2 2/9] mpathpersist: add option --batch-file (-f)

2019-05-27 Thread Martin Wilck
If a command fails, the batch processing is not aborted. The return status of mpathpersist is 0 if all commands succeeded, and the status of the first failed command otherwise. Signed-off-by: Martin Wilck --- mpathpersist/main.c | 204 mpathpersist/m

[dm-devel] [PATCH v2 3/9] mpathpersist: no need to treat error close() as fatal

2019-05-27 Thread Martin Wilck
Simplify code a bit. Signed-off-by: Martin Wilck --- mpathpersist/main.c | 11 ++- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/mpathpersist/main.c b/mpathpersist/main.c index 2e19f29f..6df9762d 100644 --- a/mpathpersist/main.c +++ b/mpathpersist/main.c @@ -154,7 +154,7

[dm-devel] [PATCH v2 4/9] libmpathpersist: updatepaths: deal with missing pp->udev

2019-05-27 Thread Martin Wilck
We will change the data structure initialization to a lazy approach, where pp->udev isn't necessarily initialized when get_mpvec() is called. Deal with it. Signed-off-by: Martin Wilck --- libmpathpersist/mpath_persist.c | 12 1 file changed, 12 insertions(+) diff

[dm-devel] [PATCH v2 6/9] mpathpersist: initialize data structures only once

2019-05-27 Thread Martin Wilck
We now have the possibility to run several PR commands in a single mpathpersist invocation. Run initialization / discovery and teardown only once at program invocation / exit. Signed-off-by: Martin Wilck --- mpathpersist/main.c | 11 --- 1 file changed, 8 insertions(+), 3 deletions

Re: [dm-devel] [PATCH] multipath: call store_pathinfo with DI_BLACKLIST

2019-06-04 Thread Martin Wilck
> Signed-off-by: Benjamin Marzinski > --- > libmultipath/discovery.c | 3 ++- > multipathd/cli_handlers.c | 2 +- > 2 files changed, 3 insertions(+), 2 deletions(-) Reviewed-by: Martin Wilck -- dm-devel mailing list dm-devel@redhat.com https://www.redhat.com/mailman/listinfo/dm-devel

[dm-devel] [PATCH 02/30] libmultipath: fix gcc -Wstringop-truncation warning in set_value()

2019-06-07 Thread Martin Wilck
)); | ^~~~ gcc's stringop checker expects that the size argument of strncat() is derived from the destination, not source, side. See https://developers.redhat.com/blog/2018/05/24/detecting-string-truncation-with-gcc-8/ Fix typo in error message along the way. Signed-off-by: M

[dm-devel] [PATCH 03/30] libmultipath: remove 'space' argument to merge_words()

2019-06-07 Thread Martin Wilck
merge_words() is always called with space = 1. Remove the argument. Signed-off-by: Martin Wilck --- libmultipath/dmparser.c | 18 +++--- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/libmultipath/dmparser.c b/libmultipath/dmparser.c index ac13ec06..04f675c1 100644

[dm-devel] [PATCH 00/30] multipath-tools: gcc9, VPD parsing, and get_uid fixes

2019-06-07 Thread Martin Wilck
patches 14, 18, 21, 22, 24). Reviews and comments welcome. Regards, Martin Martin Wilck (30): kpartx: dasd: fix -Waddress-of-packed-member warning from gcc9 libmultipath: fix gcc -Wstringop-truncation warning in set_value() libmultipath: remove 'space' argument to merge_words()

[dm-devel] [PATCH 08/30] libmultipath: inline set_default()

2019-06-07 Thread Martin Wilck
This is nothing but a reimplementation of strdup(), and it causes gcc 9 warnings. Remove it. Signed-off-by: Martin Wilck --- libmultipath/debug.c| 1 + libmultipath/defaults.c | 17 - libmultipath/defaults.h | 9 - 3 files changed, 9 insertions(+), 18 deletions

[dm-devel] [PATCH 04/30] libmultipath: fix -Wstringop-overflow warning in merge_words()

2019-06-07 Thread Martin Wilck
’: dmparser.c:41:19: note: length computed here 41 | strncpy(p, word, strlen(word) + 1); | ^~~~ Signed-off-by: Martin Wilck --- libmultipath/dmparser.c | 15 ++- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/libmultipath/dmparser.c b

[dm-devel] [PATCH 05/30] multipath-tools: fix more gcc 9 -Wstringop-truncation warnings

2019-06-07 Thread Martin Wilck
More often than not, this means replacing strncpy() by strlcpy(). Signed-off-by: Martin Wilck --- libmpathpersist/mpath_persist.c | 8 libmultipath/configure.c| 7 --- libmultipath/discovery.c| 12 ++-- libmultipath/dmparser.c | 20

[dm-devel] [PATCH 19/30] libmultipath: add consistent WWID overflow logging in parse_vpd_pg83

2019-06-07 Thread Martin Wilck
Signed-off-by: Martin Wilck --- libmultipath/discovery.c | 49 ++-- 1 file changed, 32 insertions(+), 17 deletions(-) diff --git a/libmultipath/discovery.c b/libmultipath/discovery.c index 45c2931e..e484ec8d 100644 --- a/libmultipath/discovery.c +++ b

[dm-devel] [PATCH 09/30] libmultipath: add size argument to dm_get_uuid()

2019-06-07 Thread Martin Wilck
The length of the uuid field in libdm is DM_UUID_LEN, which happens to be one byte more than our WWID_SIZE. Handle this cleanly. Signed-off-by: Martin Wilck --- libmultipath/devmapper.c | 28 +--- libmultipath/devmapper.h | 2 +- libmultipath/wwids.c | 3

[dm-devel] [PATCH 07/30] libmpathcmd: use target length in strncpy() call

2019-06-07 Thread Martin Wilck
Signed-off-by: Martin Wilck --- libmpathcmd/mpath_cmd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libmpathcmd/mpath_cmd.c b/libmpathcmd/mpath_cmd.c index b681311b..05b69316 100644 --- a/libmpathcmd/mpath_cmd.c +++ b/libmpathcmd/mpath_cmd.c @@ -104,7 +104,7 @@ int

[dm-devel] [PATCH 15/30] libmultipath: Fix buffer overflow in parse_vpd_pg80()

2019-06-07 Thread Martin Wilck
We set out[len] = '\0' later, thus we should set len to no more then out_len - 1. Fixes: 756ef73b7197 "Separate out vpd parsing functions" Signed-off-by: Martin Wilck --- libmultipath/discovery.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libmul

[dm-devel] [PATCH 14/30] libmultipath: fix parsing of VPD 83 type 1 (T10 vendor ID)

2019-06-07 Thread Martin Wilck
uot;Read wwid from sysfs vpg_pg83 attribute" Signed-off-by: Martin Wilck --- libmultipath/discovery.c | 11 +-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/libmultipath/discovery.c b/libmultipath/discovery.c index 407e64a0..f360e306 100644 --- a/libmultipath/disc

[dm-devel] [PATCH 12/30] multipath-tools tests: add strlcpy() tests

2019-06-07 Thread Martin Wilck
As we're using strlcpy quite a bit, make sure it works as designed. Signed-off-by: Martin Wilck --- tests/util.c | 142 +++ 1 file changed, 142 insertions(+) diff --git a/tests/util.c b/tests/util.c index e6d4b9ab..4e04a480 100644 --- a/

[dm-devel] [PATCH 11/30] tests/hwtable: decrease log verbosity

2019-06-07 Thread Martin Wilck
Signed-off-by: Martin Wilck --- tests/hwtable.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/hwtable.c b/tests/hwtable.c index 13da1d99..f436f52d 100644 --- a/tests/hwtable.c +++ b/tests/hwtable.c @@ -457,7 +457,7 @@ static void replicate_config(const struct

[dm-devel] [PATCH 28/30] multipath-tools tests: add test for uid_attrs parsing

2019-06-07 Thread Martin Wilck
Signed-off-by: Martin Wilck --- tests/uevent.c | 18 ++ 1 file changed, 18 insertions(+) diff --git a/tests/uevent.c b/tests/uevent.c index 215d97ad..f4afd9b4 100644 --- a/tests/uevent.c +++ b/tests/uevent.c @@ -95,6 +95,23 @@ static void test_ro_good(void **state

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