Re: [dm-devel] [PATCH] multipath-tools:Prioritizer based on a time-delay algorithm

2017-05-11 Thread Martin Wilck
= timeval_to_us(); > + > +delay = after - before; > +if (delay < 0) > +{ > +condlog(0, "%s: delay calc error", pp->dev); > +return 1; > +} > + > +min = (min <= delay) ? min : delay;

Re: [dm-devel] [PATCH 6/6] mpath_persist: Don't join threads that don't exist

2017-05-11 Thread Martin Wilck
> > Signed-off-by: Benjamin Marzinski <bmarz...@redhat.com> Reviewed-by: Martin Wilck <mwi...@suse.com> -- Dr. Martin Wilck <mwi...@suse.com>, Tel. +49 (0)911 74053 2107 SUSE Linux GmbH, GF: Felix Imendörffer, Jane Smithard, Graham Norton HRB 21284 (AG Nürnberg) -- dm-devel

Re: [dm-devel] [PATCH 1/3] dm: a basic support for using the select or poll function

2017-05-11 Thread Martin Wilck
On Thu, 2017-05-11 at 21:21 +0100, Alasdair G Kergon wrote: > On Thu, May 11, 2017 at 09:49:14PM +0200, Martin Wilck wrote: > > Here is an idea: the best way to avoid the race mentioned by Mike > > might > > be to set priv->global_event_nr to the h

[dm-devel] [PATCH v2 0/2] Small multipath fixes

2017-05-17 Thread Martin Wilck
is only set once per makefile. Martin Wilck (2): libmultipath: print.c: make sure lines are 0-terminated multipath-tools: fix compilation with gcc < 4.9 Makefile.inc | 15 ++- libmultipath/print.c | 25 + 2 files changed, 31 inse

[dm-devel] [PATCH v2 1/2] libmultipath: print.c: make sure lines are 0-terminated

2017-05-17 Thread Martin Wilck
len - 1) is equivalent to (TAIL >= 0). It should always hold the way ENDLINE is called after PRINT and PAD in print.c, and is only added as an additional safeguard, e.g. against future code changes. Signed-off-by: Martin Wilck <mwi...@suse.com> --- libmultipath/print.c | 25 +

[dm-devel] [PATCH] multipath-tools: enable libdmmp installation in alternative directory

2017-05-15 Thread Martin Wilck
their /usr counterparts, nothing changes. Comments are welcome. Signed-off-by: Martin Wilck <mwi...@suse.com> --- Makefile.inc | 4 +++- libdmmp/Makefile | 11 ++- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/Makefile.inc b/Makefile.inc index ad55aa10.

Re: [dm-devel] [PATCH 4/6] libmultipath: fix suspended devs from failed reloads

2017-05-16 Thread Martin Wilck
On Tue, 2017-05-16 at 12:33 -0500, Benjamin Marzinski wrote: > On Thu, May 11, 2017 at 10:26:52PM +0200, Martin Wilck wrote: > > On Tue, 2017-05-09 at 11:57 -0500, Benjamin Marzinski wrote: > > > When multipath reloads a device, it can either fail while loading > > > t

Re: [dm-devel] [PATCH] multipath-tools:Prioritizer based on a time-delay algorithm

2017-05-16 Thread Martin Wilck
LOCK_MONOTONIC, ); > +after = timeval_to_us(); > + > +delay = after - before; > + > +min = (min <= delay) ? min : delay; > +max = (max >= delay) ? max : delay; > + > +toldelay += delay; > +    } > + > +toldelay

[dm-devel] [PATCH 1/2] libmultipath: print.c: make sure lines are 0-terminated

2017-05-17 Thread Martin Wilck
Under certain conditions, the output of "multipath -ll" or "multipathd show topology", or the multipathd logs, may contain garbage characters. Fix that by making sure that the strings are always properly zero-terminated. Note 1: The way this is coded, the previously written character is

[dm-devel] [PATCH 0/2] Small multipath fixes

2017-05-17 Thread Martin Wilck
anism. My intention at was to keep the patches small and non-controversial, therefore I didn't delve into the big issues just yet. Martin Wilck (2): libmultipath: print.c: make sure lines are 0-terminated multipath-tools: fix compilation with gcc < 4.9 Makefile.inc | 15 ++-

[dm-devel] [PATCH 2/2] multipath-tools: fix compilation with gcc < 4.9

2017-05-17 Thread Martin Wilck
gcc supports -fstack-protector-strong since v4.9 only. Add a "poor man's autoconf" test to check whether the option is supported on the given build system. Fixes: 596f51f3 "multipath-tools: Replace -fstack-protector with -fstack-protector-strong" Signed-off-by: Martin Wi

[dm-devel] [PATCH v2 09/12] kpartx: use partition UUID for non-DM devices

2017-05-15 Thread Martin Wilck
" flag can be used to force delting these partitions, too. Signed-off-by: Martin Wilck <mwi...@suse.com> --- kpartx/devmapper.c | 2 +- kpartx/kpartx.c| 34 ++ 2 files changed, 35 insertions(+), 1 deletion(-) diff --git a/kpartx/devmapper.c b/kpartx/devmapper.

[dm-devel] [PATCH v2 05/12] kpartx: dm_remove_partmaps: support non-dm devices

2017-05-15 Thread Martin Wilck
of parent dev and partition is only valid for dm devices. For non-dm devices such as loop, "/dev/mapper/loop0" could, theoretically, be a partition of "/dev/loop0" (and we don't want to rely on map names). Fixes: 3d709241 "kpartx: sanitize delete partitions" Sign

[dm-devel] [PATCH v2 01/12] kpartx: test-kpartx: new unit test program

2017-05-15 Thread Martin Wilck
This is a unit test program for kpartx, in particular for deleting partitions. NOTE: This test program fails with current kpartx; full patch series needed to make it work. Signed-off-by: Martin Wilck <mwi...@suse.com> --- kpartx/test-kpartx

[dm-devel] [PATCH v2 08/12] libmultipath: don't treat multi-linear mappings as partitions

2017-05-15 Thread Martin Wilck
This is questionable, it's hard to assign a "type" to such maps anyway. Fix this by returning an error for multi-target maps. This is analogous to the patch "kpartx: don't treat multi-linear mappings as partitions". Signed-off-by: Martin Wilck <mwi...@suse.com> --- libmult

[dm-devel] [PATCH v2 02/12] kpartx: remove "no_partitions" support

2017-05-15 Thread Martin Wilck
The kernel does not support the "no_partitions" feature - remove it. Distributions who want to keep support for this feature should re-enable it with a distro-specific patch. Signed-off-by: Martin Wilck <mwi...@suse.com> --- kpartx/devmapper.c | 29 -

[dm-devel] [PATCH v2 06/12] kpartx: dm_devn: return error for non-existent device

2017-05-15 Thread Martin Wilck
For non-existent maps (ENXIO from ioctl()), dm_task_run and dm_task_get_info return success. We need to check info.exists. Signed-off-by: Martin Wilck <mwi...@suse.com> --- kpartx/devmapper.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kpartx/devmapper.c b/

[dm-devel] [PATCH v2 03/12] kpartx: remove is_loop_device

2017-05-15 Thread Martin Wilck
This function is not used any more. Signed-off-by: Martin Wilck <mwi...@suse.com> --- kpartx/lopart.c | 31 --- kpartx/lopart.h | 1 - 2 files changed, 32 deletions(-) diff --git a/kpartx/lopart.c b/kpartx/lopart.c index 2eb3f631..44f0c277 100644 --- a/

[dm-devel] [PATCH v2 07/12] kpartx: don't treat multi-linear mappings as partitions

2017-05-15 Thread Martin Wilck
kpartx -d treats any map that has a "linear" mapping into a device as first target as a partition of this device. This is wrong, because linear mappings may consist of several pieces, combining multiple devices into one (LVM logical volumes are an example of such a mapping). Partitions have to be

[dm-devel] [PATCH v2 04/12] kpartx: relax and improve UUID check in dm_compare_uuid

2017-05-15 Thread Martin Wilck
nstants. Signed-off-by: Martin Wilck <mwi...@suse.com> --- kpartx/devmapper.c | 16 +++- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/kpartx/devmapper.c b/kpartx/devmapper.c index 8aca9592..8b125be5 100644 --- a/kpartx/devmapper.c +++ b/kpartx/devmapper.c @@

[dm-devel] [PATCH v2 00/12] fixes for kpartx -d

2017-05-15 Thread Martin Wilck
us, as partition UUIDs start with "part%s-" anyway. - Added the trivial fix 12/12. Martin Wilck (12): kpartx: test-kpartx: new unit test program kpartx: remove "no_partitions" support kpartx: remove is_loop_device kpartx: relax and improve UUID check in dm_compare_uui

[dm-devel] [PATCH v2 11/12] kpartx: find_loop_by_file: use sysfs

2017-05-15 Thread Martin Wilck
Rather then searching through all of /dev, look up loop devices in /sys/devices/virtual/block. This is cleaner and more robust (/dev/loop$Xp$Y symlinks may confuse kpartx). Signed-off-by: Martin Wilck <mwi...@suse.com> --- kpartx/lopart.c | 42 +++---

[dm-devel] [PATCH v2 10/12] kpartx: use absolute path for regular files

2017-05-15 Thread Martin Wilck
be unreliable. Therefore, convert relative to absolute path for regular files. Signed-off-by: Martin Wilck <mwi...@suse.com> --- kpartx/kpartx.c | 8 +++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/kpartx/kpartx.c b/kpartx/kpartx.c index 587c3dfe..c76b5b46 100644 --- a/

[dm-devel] [PATCH v2 12/12] kpartx: include sys/sysmacros.h

2017-05-15 Thread Martin Wilck
Finish the work started in ea436715. Fixes a compilation warning. Signed-off-by: Martin Wilck <mwi...@suse.com> --- kpartx/lopart.c| 2 +- kpartx/sysmacros.h | 9 - 2 files changed, 1 insertion(+), 10 deletions(-) delete mode 100644 kpartx/sysmacros.h diff --git a/kpartx/lopa

Re: [dm-devel] [PATCH 1/3] dm: a basic support for using the select or poll function

2017-05-11 Thread Martin Wilck
It would be guaranteed that if any event had occured after the previous DM_LIST_DEVICES, whether or not that had been before or after the poll() call, userspace would notice. Cheers, Martin -- Dr. Martin Wilck <mwi...@suse.com>, Tel. +49 (0)911 74053 2107 SUSE Linux GmbH, GF: Felix Imendör

Re: [dm-devel] [PATCH 4/5] kpartx: default to running in sync mode

2017-05-11 Thread Martin Wilck
On Thu, 2017-05-11 at 12:46 -0500, Benjamin Marzinski wrote: > On Thu, May 11, 2017 at 02:42:08PM +0200, Martin Wilck wrote: > > Hi Ben, > > > > On Mon, 2017-04-24 at 17:39 -0500, Benjamin Marzinski wrote: > > > > > When users run kpartx, they would naturally

Re: [dm-devel] [PATCH 3/6] libmultipath: refactor calls to get dm device info

2017-05-11 Thread Martin Wilck
simply store all relevant information from DM_DEVICE_INFO in the mpp structure in the first place, avoiding the need to do this ioctl multiple times to get various pieces of information. That can be done in a separate patch, of course. Reviewed-by: Martin Wilck <mwi...@suse.com> Regards Martin

Re: [dm-devel] [PATCH 5/6] kpartx: fix device checks

2017-05-11 Thread Martin Wilck
off-by: Benjamin Marzinski <bmarz...@redhat.com> Reviewed-by: Martin Wilck <mwi...@suse.com> -- Dr. Martin Wilck <mwi...@suse.com>, 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@re

Re: [dm-devel] [PATCH 1/3] dm: a basic support for using the select or poll function

2017-05-11 Thread Martin Wilck
On Thu, 2017-05-11 at 09:21 -0400, Mike Snitzer wrote: > On Thu, May 11 2017 at  5:43am -0400, > Martin Wilck <mwi...@suse.com> wrote: > > > On Thu, 2017-05-11 at 11:39 +0200, Martin Wilck wrote: > > > On Tue, 2017-05-09 at 12:10 -0700, Andy Grover wrote: > &

Re: [dm-devel] [PATCH v4 0/1] multipath-tools: Prioritizer based on a latency algorithm

2017-06-09 Thread Martin Wilck
the latency intevals e.g like this: < 10us, 10us-100us, 100us-1ms, 1ms-10ms, 10ms-100ms, > 100ms IMO that would be better, in particular if the latencies differ strongly between paths. Regards Martin -- Dr. Martin Wilck <mwi...@suse.com>, Tel. +49 (0)911 74053 2107 SUSE Linux GmbH

[dm-devel] [PATCH v2 6/8] multipath.conf.5: document no_path_retry vs. queue_if_no_path

2017-06-20 Thread Martin Wilck
Clarify the documentation about option precedence. Signed-off-by: Martin Wilck <mwi...@suse.com> --- multipath/multipath.conf.5 | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/multipath/multipath.conf.5 b/multipath/multipath.conf.5 index f04ff194..6959ba5c

[dm-devel] [PATCH v2 7/8] multipath.conf.5: Remove ??? and other minor fixes

2017-06-20 Thread Martin Wilck
Remove the FIXME markers by filling in missing content, and make some other minor fixes. Signed-off-by: Martin Wilck <mwi...@suse.com> --- multipath/multipath.conf.5 | 48 +- 1 file changed, 26 insertions(+), 22 deletions(-) diff --git a/mul

[dm-devel] [PATCH v2 4/8] libmultipath: merge_hwe: fix queue_if_no_path logic

2017-06-20 Thread Martin Wilck
The logic applied here should match the logic in select_features(). This is achieved by calling reconcile_features_with_options(). Signed-off-by: Martin Wilck <mwi...@suse.com> --- libmultipath/config.c | 20 +++- 1 file changed, 11 insertions(+), 9 deletions(-) diff

[dm-devel] [PATCH v2 5/8] libmultipath: assemble_map: fix queue_if_no_path logic

2017-06-20 Thread Martin Wilck
It is wrong to remove the queue_if_no_path feature if no_path_retry is unset. Rather, in this case the feature should neither be added nor removed. Signed-off-by: Martin Wilck <mwi...@suse.com> --- libmultipath/dmparser.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff

[dm-devel] [PATCH v2 2/8] libmultipath: add/remove_feature: use const char* for feature

2017-06-20 Thread Martin Wilck
Change the argument type for the feature to add or remove to const char*, making it possible to pass const strings without warnings. Signed-off-by: Martin Wilck <mwi...@suse.com> --- libmultipath/structs.c | 30 -- libmultipath/structs.h | 4 ++-- 2 files chang

[dm-devel] [PATCH v2 0/8] multipath-tools: no_path_retry/queue_if_no_path logic

2017-06-20 Thread Martin Wilck
>features (3/8, 4/8) * Fixed whitespace error (6/8) * Added deprecated warnings (8/8) - Made sure the same logic is used in propsel.c and config.c by calling the same function (3/8, 4/8) - Added deprecated warnings (8/8) Martin Wilck (8): libmultipath: load_config: skip setting unnece

[dm-devel] [PATCH v2 8/8] libmultipath: add deprecated warning for some features settings

2017-06-20 Thread Martin Wilck
ures" settings are encountered. So far these "features" settings will only be ignored if the respective other keyword is set, so in particular 'features "1 queue_if_no_path"' will still work as expected, but cause the warning to be printed. We should consider ignoring the

Re: [dm-devel] [PATCH v2 0/8] multipath-tools: no_path_retry/queue_if_no_path logic

2017-06-20 Thread Martin Wilck
t: use extern struct udev from main program" "libmultipath: lazy device-mapper initialization" "mpathpersist.8: add missing documentation for -K, -C, -l" Martin -- Dr. Martin Wilck <mwi...@suse.com>, Tel. +49 (0)911 74053 2107 SUSE Linux GmbH, GF: Felix Imendörffer,

Re: [dm-devel] [PATCH v2 0/8] multipath-tools: no_path_retry/queue_if_no_path logic

2017-06-20 Thread Martin Wilck
On Tue, 2017-06-20 at 13:44 -0500, Benjamin Marzinski wrote: > Review and comments are highly welcome. > > ACK for the set I found another issue with the patch set, will send v3 shortly. Martin -- Dr. Martin Wilck <mwi...@suse.com>, Tel. +49 (0)911 74053 2107 SUSE Linux

Re: [dm-devel] [PATCH v3 11/11] libmultipath: don't [un]set queue_if_no_path after domap

2017-06-22 Thread Martin Wilck
On Thu, 2017-06-22 at 08:23 +0200, Hannes Reinecke wrote: > On 06/21/2017 05:06 PM, Martin Wilck wrote: > > We set the queue_if_no_path feature in assemble_map() already, > > no need to set it here again. > > > > Signed-off-by: Martin Wilck <mwi...@suse.com> >

Re: [dm-devel] [PATCH v3 10/11] libmultipath: don't try to set hwhandler if it is retained

2017-06-22 Thread Martin Wilck
On Thu, 2017-06-22 at 08:21 +0200, Hannes Reinecke wrote: > On 06/21/2017 05:06 PM, Martin Wilck wrote: > > Setting a device handler only works if retain_attached_hw_handler > > is 'no', or if the kernel didn't auto-assign a handler. If this > > is not the case, don'

Re: [dm-devel] [PATCH v3 00/11] multipath-tools: no_path_retry/queue_if_no_path/hwhandler logic

2017-06-21 Thread Martin Wilck
On Wed, 2017-06-21 at 17:06 +0200, Martin Wilck wrote: > > Changes wrt v2: > - Added Acked-by:/Reviewed-by: tags > - 1/11: clarify comment in select_max_sectors_kb (Hannes Reinecke) > - 3/11: call select_retain_hwhandler before select_features > - 8/11: d

[dm-devel] [PATCH v3 09/11] libmultipath: retain_attached_hw_handler obsolete with 4.3+

2017-06-21 Thread Martin Wilck
Kernels 4.3 and newer (commit 1bab0de0 "dm-mpath, scsi_dh: don't let dm detach device handlers") imply "retain_attached_hw_handler yes". Clarify this in the propsel code, log messages, and documentation. Signed-off-by: Martin Wilck <mwi...@suse.com> --- libmu

[dm-devel] [PATCH v3 10/11] libmultipath: don't try to set hwhandler if it is retained

2017-06-21 Thread Martin Wilck
attribute must be updated after domap(). Signed-off-by: Martin Wilck <mwi...@suse.com> --- libmultipath/configure.c | 52 +++- libmultipath/discovery.c | 4 libmultipath/propsel.c | 15 ++ libmultipath/structs.h | 2 ++ 4 f

[dm-devel] [PATCH v3 08/11] libmultipath: add deprecated warning for some features settings

2017-06-21 Thread Martin Wilck
ures" settings are encountered. So far these "features" settings will only be ignored if the respective other keyword is set, so in particular 'features "1 queue_if_no_path"' will still work as expected, but cause the warning to be printed. We should consider ignoring the

[dm-devel] [PATCH v3 02/11] libmultipath: add/remove_feature: use const char* for feature

2017-06-21 Thread Martin Wilck
Change the argument type for the feature to add or remove to const char*, making it possible to pass const strings without warnings. Signed-off-by: Martin Wilck <mwi...@suse.com> Reviewed-by: Hannes Reinecke <h...@suse.com> --- libmultipath/st

[dm-devel] [PATCH v3 04/11] libmultipath: merge_hwe: fix queue_if_no_path logic

2017-06-21 Thread Martin Wilck
The logic applied here should match the logic in select_features(). This is achieved by calling reconcile_features_with_options(). Signed-off-by: Martin Wilck <mwi...@suse.com> Acked-by: Benjamin Marzinski <bmarz...@redhat.com> --- libmultipath/config.c | 20 +++- 1

[dm-devel] [PATCH v3 00/11] multipath-tools: no_path_retry/queue_if_no_path/hwhandler logic

2017-06-21 Thread Martin Wilck
s (8/8) Changes wrt v2: - Added Acked-by:/Reviewed-by: tags - 1/11: clarify comment in select_max_sectors_kb (Hannes Reinecke) - 3/11: call select_retain_hwhandler before select_features - 8/11: don't suggest using retain_attached_hw_handler in log msg - 9/11, 10/11, 11/11: new Martin Wilck (11)

[dm-devel] [PATCH v3 05/11] libmultipath: assemble_map: fix queue_if_no_path logic

2017-06-21 Thread Martin Wilck
It is wrong to remove the queue_if_no_path feature if no_path_retry is unset. Rather, in this case the feature should neither be added nor removed. Signed-off-by: Martin Wilck <mwi...@suse.com> Acked-by: Benjamin Marzinski <bmarz...@redhat.com> --- libmultipath/dmparser.c | 5 +

[dm-devel] [PATCH v3 03/11] libmultipath: clarify option conflicts for "features"

2017-06-21 Thread Martin Wilck
Put this logic into a separate function, which can be used from other places in the code. Signed-off-by: Martin Wilck <mwi...@suse.com> --- libmultipath/configure.c | 6 ++--- libmultipath/propsel.c | 68 +--- libmultipath/propsel.h | 3

[dm-devel] [PATCH v3 07/11] multipath.conf.5: Remove ??? and other minor fixes

2017-06-21 Thread Martin Wilck
Remove the FIXME markers by filling in missing content, and make some other minor fixes. Signed-off-by: Martin Wilck <mwi...@suse.com> Acked-by: Benjamin Marzinski <bmarz...@redhat.com> --- multipath/multipath.conf.5 | 48 +- 1 file

[dm-devel] [PATCH v3 01/11] libmultipath: load_config: skip setting unnecessary defaults

2017-06-21 Thread Martin Wilck
es setting at all. For some config settings, we need to use declare_def_snprint_defint() now to make sure "multipathd show config" prints all defaults correctly. To avoid confusion, we don't do this for "max_sectors", because multipathd leaves this untouched by default. Si

[dm-devel] [PATCH v4 10/11] libmultipath: don't try to set hwhandler if it is retained

2017-06-22 Thread Martin Wilck
Setting a device handler only works if retain_attached_hw_handler is 'no', or if the kernel didn't auto-assign a handler. If this is not the case, don't even attempt to set a different handler. This requires reading the sysfs "dh_state" path attribute. Signed-off-by: Martin

[dm-devel] [PATCH v4 07/11] multipath.conf.5: Remove ??? and other minor fixes

2017-06-22 Thread Martin Wilck
Remove the FIXME markers by filling in missing content, and make some other minor fixes. Signed-off-by: Martin Wilck <mwi...@suse.com> Acked-by: Benjamin Marzinski <bmarz...@redhat.com> Reviewed-by: Hannes Reinecke <h...@suse.com> --- multipath/mul

[dm-devel] [PATCH v4 09/11] libmultipath: retain_attached_hw_handler obsolete with 4.3+

2017-06-22 Thread Martin Wilck
Kernels 4.3 and newer (commit 1bab0de0 "dm-mpath, scsi_dh: don't let dm detach device handlers") imply "retain_attached_hw_handler yes". Clarify this in the propsel code, log messages, and documentation. Signed-off-by: Martin Wilck <mwi...@suse.com> Reviewed-by: Hann

[dm-devel] [PATCH v4 08/11] libmultipath: add deprecated warning for some features settings

2017-06-22 Thread Martin Wilck
ures" settings are encountered. So far these "features" settings will only be ignored if the respective other keyword is set, so in particular 'features "1 queue_if_no_path"' will still work as expected, but cause the warning to be printed. We should consider ignoring the

[dm-devel] [PATCH v4 00/11] multipath-tools: no_path_retry/queue_if_no_path/hwhandler logic

2017-06-22 Thread Martin Wilck
- Added Reviewed-by: tags (kept Ben's Ack in 4/11 although patch slightly changed) - 4/11: use a buffer on stack rather than malloc (Hannes Reinecke) - 10/11: Simplify by checking dh_state only in select_handler (Hannes Reinecke) Martin Wilck (11): libmultipath: load_config: skip sett

[dm-devel] [PATCH v4 06/11] multipath.conf.5: document no_path_retry vs. queue_if_no_path

2017-06-22 Thread Martin Wilck
Clarify the documentation about option precedence. Signed-off-by: Martin Wilck <mwi...@suse.com> Acked-by: Benjamin Marzinski <bmarz...@redhat.com> Reviewed-by: Hannes Reinecke <h...@suse.com> --- multipath/multipath.conf.5 | 4 +++- 1 file changed, 3 insertions(+), 1 delet

[dm-devel] [PATCH v4 03/11] libmultipath: clarify option conflicts for "features"

2017-06-22 Thread Martin Wilck
Put this logic into a separate function, which can be used from other places in the code. Signed-off-by: Martin Wilck <mwi...@suse.com> Reviewed-by: Hannes Reinecke <h...@suse.com> --- libmultipath/configure.c | 6 ++--- libmultipath/propsel.c | 68 ++

[dm-devel] [PATCH v4 01/11] libmultipath: load_config: skip setting unnecessary defaults

2017-06-22 Thread Martin Wilck
es setting at all. For some config settings, we need to use declare_def_snprint_defint() now to make sure "multipathd show config" prints all defaults correctly. To avoid confusion, we don't do this for "max_sectors", because multipathd leaves this untouched by default. Si

[dm-devel] [PATCH v4 04/11] libmultipath: merge_hwe: fix queue_if_no_path logic

2017-06-22 Thread Martin Wilck
The logic applied here should match the logic in select_features(). This is achieved by calling reconcile_features_with_options(). Signed-off-by: Martin Wilck <mwi...@suse.com> Acked-by: Benjamin Marzinski <bmarz...@redhat.com> --- libmultipath/config.c | 15 ++- 1 fil

[dm-devel] [PATCH v4 02/11] libmultipath: add/remove_feature: use const char* for feature

2017-06-22 Thread Martin Wilck
Change the argument type for the feature to add or remove to const char*, making it possible to pass const strings without warnings. Signed-off-by: Martin Wilck <mwi...@suse.com> Acked-by: Benjamin Marzinski <bmarz...@redhat.com> Reviewed-by: Hannes Reinecke <h...@suse.com>

[dm-devel] [PATCH v4 05/11] libmultipath: assemble_map: fix queue_if_no_path logic

2017-06-22 Thread Martin Wilck
It is wrong to remove the queue_if_no_path feature if no_path_retry is unset. Rather, in this case the feature should neither be added nor removed. Signed-off-by: Martin Wilck <mwi...@suse.com> Acked-by: Benjamin Marzinski <bmarz...@redhat.com> Reviewed-by: Hannes Reinecke &l

[dm-devel] [PATCH v4 11/11] libmultipath: don't [un]set queue_if_no_path after domap

2017-06-22 Thread Martin Wilck
We set the queue_if_no_path feature in assemble_map() already, no need to set it here again. Signed-off-by: Martin Wilck <mwi...@suse.com> --- libmultipath/configure.c | 15 --- 1 file changed, 15 deletions(-) diff --git a/libmultipath/configure.c b/libmultipath/configure.c

Re: [dm-devel] [PATCH v3 11/11] libmultipath: don't [un]set queue_if_no_path after domap

2017-06-22 Thread Martin Wilck
On Thu, 2017-06-22 at 14:21 -0500, Benjamin Marzinski wrote: > On Thu, Jun 22, 2017 at 08:23:44AM +0200, Hannes Reinecke wrote: > > On 06/21/2017 05:06 PM, Martin Wilck wrote: > > > We set the queue_if_no_path feature in assemble_map() already, > > > n

[dm-devel] [PATCH] kpartx.rules: Fix syntax error in skip_kpartx code

2017-06-23 Thread Martin Wilck
Fixes: 22736419 "kpartx.rules: respect skip_kpartx flag" Signed-off-by: Martin Wilck <mwi...@suse.com> --- kpartx/kpartx.rules | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kpartx/kpartx.rules b/kpartx/kpartx.rules index a9587917..64d550de 100644 --- a/kpa

Re: [dm-devel] [PATCH v4 09/11] libmultipath: retain_attached_hw_handler obsolete with 4.3+

2017-06-26 Thread Martin Wilck
On Fri, 2017-06-23 at 19:25 +0200, Xose Vazquez Perez wrote: > On 06/22/2017 04:59 PM, Martin Wilck wrote: > > > Kernels 4.3 and newer (commit 1bab0de0 "dm-mpath, scsi_dh: don't > > let dm detach device handlers") imply "retain_attached_hw_handler > > yes

Re: [dm-devel] [PATCH 3/7] libmultipath: clarify option conflicts for "features"

2017-06-19 Thread Martin Wilck
Hi Ben, On Thu, 2017-06-15 at 14:54 -0500, Benjamin Marzinski wrote: > On Wed, Jun 14, 2017 at 12:55:50AM +0200, Martin Wilck wrote: > > The "features" option in multipath.conf can possibly conflict > > with the "no_path_retry" and "retain_attached

[dm-devel] [PATCH] Clarify commit message in select_max_sectors_kb()

2017-06-20 Thread Martin Wilck
Do you like it better this way? --- libmultipath/propsel.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/libmultipath/propsel.c b/libmultipath/propsel.c index f11052f2..6d628052 100644 --- a/libmultipath/propsel.c +++ b/libmultipath/propsel.c @@ -798,8 +798,9 @@ int

Re: [dm-devel] [PATCH 08/15] dm mpath: merge do_end_io_bio into multipath_end_io_bio

2017-05-22 Thread Martin Wilck
LETE; > +done: >   if (pgpath) { > - ps = >pg->ps; > + struct path_selector *ps = >pg->ps; > + >   if (ps->type->end_io) >   ps->type->end_io(ps, >path, mpio- > >nr_bytes); >   } >   > - return r; > + return error; >  } >   >  /* -- Dr. Martin Wilck <mwi...@suse.com>, 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

[dm-devel] [PATCH] mpathpersist.8: add missing documentation for -K, -C, -l

2017-05-22 Thread Martin Wilck
Furthermore, add a reference to the sg_persist man page. --- mpathpersist/mpathpersist.8 | 21 - 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/mpathpersist/mpathpersist.8 b/mpathpersist/mpathpersist.8 index 4b15666f..a8982e65 100644 ---

Re: [dm-devel] [PATCH] libmultipath: add comment about resuming

2017-05-22 Thread Martin Wilck
On Thu, 2017-05-18 at 16:37 -0500, Benjamin Marzinski wrote: > The reason for the second resume in my commit "libmultipath: fix > suspended devs from failed reloads" is not obvious from the multipath > code, so add a comment. Nice, thank you. Martin -- Dr. Martin Wilck <

Re: [dm-devel] [PATCH 4/4] multipath: Fix a potential buffer overflow

2017-06-13 Thread Martin Wilck
g(3, "%s: reply = %s", param, *reply); > how about this simpler patch, as prflag is actually a boolean? diff --git a/multipathd/cli_handlers.c b/multipathd/cli_handlers.c index 04c73866..c31ebd34 100644 --- a/multipathd/cli_handlers.c +++ b/multipathd/cli_handlers.c @@ -1337,7 +1337,7 @@ cli_g

Re: [dm-devel] [PATCH 3/4] libmultipath/datacore: Remove dead code

2017-06-13 Thread Martin Wilck
> + snprintf(sdsname, sizeof(sdsname), "%.16s", inqBuffp + 112); > > if (strstr(sdsname , preferredsds)) > return 1; I was wondering whether passing sizeof(sdsname) rather than 17 might make a difference, and verified that that isn't the case. Revie

Re: [dm-devel] [PATCH 4/4] multipath: Fix a potential buffer overflow

2017-06-13 Thread Martin Wilck
On Tue, 2017-06-13 at 12:53 -0700, Bart Van Assche wrote: > On 06/13/17 12:29, Martin Wilck wrote: > > how about this simpler patch, as prflag is actually a boolean? > > > > diff --git a/multipathd/cli_handlers.c b/multipathd/cli_handlers.c > > index 04c73866..c31ebd34

Re: [dm-devel] [PATCH 2/4] libmultipath: Simplify assemble_map()

2017-06-13 Thread Martin Wilck
t; Signed-off-by: Bart Van Assche <bart.vanass...@sandisk.com> > --- > libmultipath/dmparser.c | 67 +++-- > > 1 file changed, 31 insertions(+), 36 deletions(-) > Reviewed-by: Martin Wilck <mwi...@suse.com> -- Dr. Martin Wilck

Re: [dm-devel] libmultipath issue

2017-06-13 Thread Martin Wilck
d to lookup parameters in the hwtable, and there we have no entries with empty vendor or product. One side issue that needs to be considered is printout, though: snprint_multipath_(vpr|prod|vend) will just print nothing if either vendor or product has zero length. It would be good if they'd print e.g. ""

Re: [dm-devel] [PATCH 4/4] multipath: Fix a potential buffer overflow

2017-06-13 Thread Martin Wilck
lar case, I think the problem at hand be easily solved without resorting to _GNU_SOURCE. But well, it's not a thing worth fighting about. May Christophe decide. Martin -- Dr. Martin Wilck <mwi...@suse.com>, 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

[dm-devel] [PATCH 0/7] no_path_retry/queue_if_no_path logic & logging/man page fixes

2017-06-13 Thread Martin Wilck
e config settings become more appropriate. Review and comments are highly welcome. Regards, Martin Martin Wilck (7): libmultipath: load_config: skip setting unnecessary defaults libmultipath: add/remove_feature: use const char* for feature libmultipath: clarify option conflicts fo

[dm-devel] [PATCH 4/7] libmultipath: merge_hwe: fix queue_if_no_path logic

2017-06-13 Thread Martin Wilck
t; is set is treated as if "no_path_retry queue" had been set. Signed-off-by: Martin Wilck <mwi...@suse.com> --- libmultipath/config.c | 20 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/libmultipath/config.c b/libmultipath/config.c index 61bbba91

[dm-devel] [PATCH 5/7] libmultipath: assemble_map: fix queue_if_no_path logic

2017-06-13 Thread Martin Wilck
It is wrong to remove the queue_if_no_path feature if no_path_retry is unset. Rather, in this case the feature should neither be added nor removed. Signed-off-by: Martin Wilck <mwi...@suse.com> --- libmultipath/dmparser.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff

[dm-devel] [PATCH 2/7] libmultipath: add/remove_feature: use const char* for feature

2017-06-13 Thread Martin Wilck
Change the argument type for the feature to add or remove to const char*, making it possible to pass const strings without warnings. Signed-off-by: Martin Wilck <mwi...@suse.com> --- libmultipath/structs.c | 30 -- libmultipath/structs.h | 4 ++-- 2 files chang

[dm-devel] [PATCH 1/7] libmultipath: load_config: skip setting unnecessary defaults

2017-06-13 Thread Martin Wilck
'features' setting at all. With this patch, these defaults are correctly logged as "multipath internal". Signed-off-by: Martin Wilck <mwi...@suse.com> --- libmultipath/config.c | 16 libmultipath/propsel.c | 2 +- 2 files changed, 1 insertion(+), 17 deletions(-)

[dm-devel] [PATCH 3/7] libmultipath: clarify option conflicts for "features"

2017-06-13 Thread Martin Wilck
rules are defined for "retain_attached_hw_handler". Make this behavior more consistent by always giving precedence to the explicit config file options, and improve logging. Signed-off-by: Martin Wilck <mwi...@suse.com> --- libmultipath/configure.c | 4 ++-- libmultipath/propsel.c

[dm-devel] [PATCH 7/7] multipath.conf.5: Remove ??? and other minor fixes

2017-06-13 Thread Martin Wilck
Remove the FIXME markers by filling in missing content, and make some other minor fixes. Signed-off-by: Martin Wilck <mwi...@suse.com> --- multipath/multipath.conf.5 | 48 +- 1 file changed, 26 insertions(+), 22 deletions(-) diff --git a/mul

[dm-devel] [PATCH 6/7] multipath.conf.5: document no_path_retry vs. queue_if_no_path

2017-06-13 Thread Martin Wilck
Clarify the documentation about option precedence. Signed-off-by: Martin Wilck <mwi...@suse.com> --- multipath/multipath.conf.5 | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/multipath/multipath.conf.5 b/multipath/multipath.conf.5 index f04ff194..e6944faf

Re: [dm-devel] [PATCH v5 1/1] multipath-tools: Prioritizer based on a latency algorithm

2017-06-14 Thread Martin Wilck
|...| > --| > Priority Rank Partitioning > > Signed-off-by: Yang Feng <philip.y...@huawei.com> > Reviewed-by: Benjamin Marzinski <bmarz...@redhat.com> > Reviewed-by: Martin Wilck <mwi...@suse.com> > Reviewed-by: Xose Vaz

Re: [dm-devel] [PATCH 00/10] fixes for kpartx -d

2017-05-08 Thread Martin Wilck
On Mon, 2017-05-08 at 09:47 +0200, Martin Wilck wrote: > The full partition UUID for partitions used by my code looks like > this > (see patch 08/10): > > {UUID_PREFIX}${MAJOR}:${MINOR}-${NONDM_UUID_SUFFIX}" ... where UUID_PREFIX is what kpartx uses anyway, i.e. "part$N&

Re: [dm-devel] [PATCH 08/10] kpartx: use partition UUID for non-DM devices

2017-05-08 Thread Martin Wilck
On Fri, 2017-05-05 at 23:30 +0100, Alasdair G Kergon wrote: > On Sat, May 06, 2017 at 12:05:57AM +0200, Martin Wilck wrote: > > Introduce a "fake" UUID for these devices to make sure kpartx > > deletes only devices it had created previously. Otherwise kpartx >

Re: [dm-devel] [PATCH 00/10] fixes for kpartx -d

2017-05-05 Thread Martin Wilck
On Fri, 2017-05-05 at 23:18 +0100, Alasdair G Kergon wrote: > On Sat, May 06, 2017 at 12:05:49AM +0200, Martin Wilck wrote: > >   3) kpartx should only delete "partitions", which are single- > > target > >  linear mappings into a block device. Other

Re: [dm-devel] [PATCH 00/10] fixes for kpartx -d

2017-05-05 Thread Martin Wilck
On Sat, 2017-05-06 at 00:30 +0200, Martin Wilck wrote: > On Fri, 2017-05-05 at 23:18 +0100, Alasdair G Kergon wrote: > > On Sat, May 06, 2017 at 12:05:49AM +0200, Martin Wilck wrote: > > >   3) kpartx should only delete "partitions", which are single- > > &

[dm-devel] [PATCH 08/10] kpartx: use partition UUID for non-DM devices

2017-05-05 Thread Martin Wilck
" flag can be used to force delting these partitions, too. Signed-off-by: Martin Wilck <mwi...@suse.com> --- kpartx/devmapper.c | 2 +- kpartx/kpartx.c| 29 + 2 files changed, 30 insertions(+), 1 deletion(-) diff --git a/kpartx/devmapper.c b/kpartx/devmapper.

[dm-devel] [PATCH 02/10] kpartx: avoid ioctl error for loop devices

2017-05-05 Thread Martin Wilck
Commit 3d709241 causes kpartx to attempt a dm ioctl on a loop device. This causes an error message "device-mapper: table ioctl on loop4 failed: No such device or address". Fixes: 3d709241 "kpartx: sanitize delete partitions" Signed-off-by: Martin Wilck <mwi...@suse.com>

[dm-devel] [PATCH 01/10] kpartx: test-kpartx: new unit test program

2017-05-05 Thread Martin Wilck
This is a unit test program for kpartx, in particular for deleting partitions. NOTE: This test program fails with current kpartx; full patch series needed to make it work. Signed-off-by: Martin Wilck <mwi...@suse.com> --- kpartx/test-kpartx

[dm-devel] [PATCH 06/10] kpartx: don't treat multi-linear mappings as partitions

2017-05-05 Thread Martin Wilck
kpartx -d treats any map that has a "linear" mapping into a device as first target as a partition of this device. This is wrong, because linear mappings may consist of several pieces, combining multiple devices into one (LVM logical volumes are an example of such a mapping). Partitions have to be

[dm-devel] [PATCH 09/10] kpartx: use absolute path for regular files

2017-05-05 Thread Martin Wilck
be unreliable. Therefore, convert relative to absolute path for regular files. Signed-off-by: Martin Wilck <mwi...@suse.com> --- kpartx/kpartx.c | 8 +++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/kpartx/kpartx.c b/kpartx/kpartx.c index d9057fba..3bd16452 100644 --- a/

[dm-devel] [PATCH 04/10] kpartx: dm_remove_partmaps: support non-dm devices

2017-05-05 Thread Martin Wilck
of parent dev and partition is only valid for dm devices. For non-dm devices such as loop, "/dev/mapper/loop0" could, theoretically, be a partition of "/dev/loop0" (and we don't want to rely on map names). Fixes: 3d709241 "kpartx: sanitize delete partitions" Sign

[dm-devel] [PATCH 10/10] kpartx: find_loop_by_file: use sysfs

2017-05-05 Thread Martin Wilck
Rather then searching through all of /dev, look up loop devices in /sys/devices/virtual/block. This is cleaner and more robust (/dev/loop$Xp$Y symlinks may confuse kpartx). Signed-off-by: Martin Wilck <mwi...@suse.com> --- kpartx/lopart.c | 42 +++---

[dm-devel] [PATCH 07/10] libmultipath: don't treat multi-linear mappings as partitions

2017-05-05 Thread Martin Wilck
This is questionable, it's hard to assign a "type" to such maps anyway. Fix this by returning an error for multi-target maps. This is analogous to the patch "kpartx: don't treat multi-linear mappings as partitions". Signed-off-by: Martin Wilck <mwi...@suse.com> --- libmult

[dm-devel] [PATCH 00/10] fixes for kpartx -d

2017-05-05 Thread Martin Wilck
ent and is therefore included although this series is otherwise focused only on kpartx. Feedback is welcome. Martin Wilck (10): kpartx: test-kpartx: new unit test program kpartx: avoid ioctl error for loop devices kpartx: remove is_loop_device kpartx: dm_remove_partmaps: support non-dm devic

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