Re: [PATCH] multipath.conf.5: fix the description of prio_args for path_latency prio

2024-06-12 Thread Martin Wilck
On Wed, 2024-06-12 at 14:18 +0800, 303146...@qq.com wrote: > From: Kou Wenqi > > This aligns the description of prio_args for path_latency prio and > the actual code. > > Signed-off-by: Kou Wenqi Thanks! Reviewed-by: Martin Wilck

Re: [PATCH v2 7/7] multipath-tools man pages: Add format wildcard descriptions

2024-06-04 Thread Martin Wilck
On Tue, 2024-06-04 at 17:46 +0200, Martin Wilck wrote: > On Thu, 2024-05-30 at 12:55 -0400, Benjamin Marzinski wrote: > > Suggested-by: Nitin Yewale > > Signed-off-by: Benjamin Marzinski > > Reviewed-by: Martin Wilck > Our spell checker found some minor mistakes, which I will just fix.

Re: [PATCH v2 3/7] libmultipath: print all values in snprint_failback

2024-06-04 Thread Martin Wilck
On Thu, 2024-05-30 at 12:54 -0400, Benjamin Marzinski wrote: > Add the missing output for manual failback and print the defferral > time > for deferred failbacks, if one isn't currently in progress. > > Signed-off-by: Benjamin Marzinski Reviewed-by: Martin Wilck

Re: [PATCH v2 7/7] multipath-tools man pages: Add format wildcard descriptions

2024-06-04 Thread Martin Wilck
On Thu, 2024-05-30 at 12:55 -0400, Benjamin Marzinski wrote: > Suggested-by: Nitin Yewale > Signed-off-by: Benjamin Marzinski Reviewed-by: Martin Wilck

Re: [PATCH 7/7] multipath-tools man pages: Add format wildcard descriptions

2024-05-24 Thread Martin Wilck
On Mon, 2024-05-13 at 15:11 -0400, Benjamin Marzinski wrote: > On Mon, May 13, 2024 at 01:36:46PM -0400, Benjamin Marzinski wrote: > > Suggested-by: Nitin Yewale > > Signed-off-by: Benjamin Marzinski > > Oops. I forgot to update the man page date. Martin, either I can send > a > new patch or

Re: [PATCH 0/7] multipath-tools man pages: add missing information

2024-05-24 Thread Martin Wilck
 multipathd/multipathd.8.in | 260 > +++-- >  3 files changed, 263 insertions(+), 24 deletions(-) > For the series, except 3/7 and 7/7: Reviewed-by: Martin Wilck

Re: [PATCH 7/7] multipath-tools man pages: Add format wildcard descriptions

2024-05-24 Thread Martin Wilck
On Mon, 2024-05-13 at 13:36 -0400, Benjamin Marzinski wrote: > Suggested-by: Nitin Yewale > Signed-off-by: Benjamin Marzinski Thanks. This is useful, but I have a few additional suggestions below. Martin > --- >  multipathd/multipathd.8.in | 211 > - >  1

Re: [PATCH 3/7] libmultipath: print all values in snprint_failback

2024-05-24 Thread Martin Wilck
On Mon, 2024-05-13 at 13:36 -0400, Benjamin Marzinski wrote: > Add the missing output for manual failback and print the defferral > time > for deferred failbacks, if one isn't currently in progress. > > Signed-off-by: Benjamin Marzinski > --- >  libmultipath/print.c | 6 +- >  1 file changed,

Re: [PATCH 0/2] multipathd: accept more multipath device names

2024-05-24 Thread Martin Wilck
horrible names, > but > still valid. > > Benjamin Marzinski (2): >   libmultipath: accept poorly chosen aliases in find_mp_by_str >   libmultipath: accept wwids in find_mp_by_str > >  libmultipath/structs.c | 11 +++ >  1 file changed, 7 insertions(+), 4 deletio

[PATCH 2/3] libmultipath: use bitwise flags for dm_simplecmd API

2024-05-02 Thread Martin Wilck
Also use bitwise flags for dm_simplecmd() and its relatives. Again, this makes the code more expressive and more readable, while simplifying the function calls. Signed-off-by: Martin Wilck --- libmultipath/devmapper.c | 26 +- libmultipath/devmapper.h | 5 +++-- 2 files

[PATCH 3/3] libmultipath: add argument names to some prototypes

2024-05-02 Thread Martin Wilck
Signed-off-by: Martin Wilck --- libmultipath/devmapper.h | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/libmultipath/devmapper.h b/libmultipath/devmapper.h index a242381..19b79c5 100644 --- a/libmultipath/devmapper.h +++ b/libmultipath/devmapper.h @@ -42,12 +42,12

[PATCH 1/3] libmultipath: use bitwise flags for map flushing API

2024-05-02 Thread Martin Wilck
Rather than passing 3 separate bool variables to _dm_flush_map(), define bitwise flags to modify the function's behavior, and pass these flags to called functions accordingly. This improves the readability of the code, function calls are more expressive. Signed-off-by: Martin Wilck

[PATCH 0/3] libmultipath: use bitwise flags in devmapper API

2024-05-02 Thread Martin Wilck
arguments, but that's not the main intention. The symbolic flags improve the readability of the code by making it obvious which flags are passed to the respective functions in their callers. Martin Wilck (3): libmultipath: use bitwise flags for map flushing API libmultipath: use bit

Re: [PATCH v2 4/5] libmultipath: pad dev_loss_tmo to avoid race with no_path_retry

2024-05-02 Thread Martin Wilck
On Thu, 2024-05-02 at 12:05 -0400, Benjamin Marzinski wrote: > On Thu, May 02, 2024 at 05:14:56PM +0200, Martin Wilck wrote: > > On Thu, 2024-04-25 at 19:35 -0400, Benjamin Marzinski wrote: > > > Currently multipath makes sure that dev_loss_tmo is at l

Re: [PATCH v2 5/5] libmultipath: fix deferred_remove function arguments

2024-05-02 Thread Martin Wilck
uot; to express the semantics more clearly. But I have something more intrusive in mind. I'll post a patch on top of your series. Thus: Reviewed-by: Martin Wilck

Re: [PATCH v2 4/5] libmultipath: pad dev_loss_tmo to avoid race with no_path_retry

2024-05-02 Thread Martin Wilck
On Thu, 2024-04-25 at 19:35 -0400, Benjamin Marzinski wrote: > Currently multipath makes sure that dev_loss_tmo is at least as long > as > the configured no path queueing time. The goal is to make sure that > path > devices aren't removed while the multipath device is still queueing > in > hopes

Re: [PATCH v2 2/5] libmultipath: change flush_on_last_del to fix a multipathd hang

2024-05-02 Thread Martin Wilck
tter than hanging. > > Signed-off-by: Benjamin Marzinski > --- >  libmultipath/defaults.h   |  2 +- >  libmultipath/dict.c   | 72 +++-- > -- >  libmultipath/dict.h   |  1 + >  libmultipath/hwtable.c    |  6 +-- >  libmultipath/propsel.c 

Re: [PATCH 1/3] libmultipath: export partmap_in_use and do_deferred

2024-05-02 Thread Martin Wilck
th.version | 1 + >  3 files changed, 5 insertions(+), 3 deletions(-) > Reviewed-by: Martin Wilck

Re: [PATCH v2 2/5] libmultipath: change flush_on_last_del to fix a multipathd hang

2024-05-02 Thread Martin Wilck
On Tue, 2024-04-30 at 17:29 -0400, Benjamin Marzinski wrote: > On Tue, Apr 30, 2024 at 07:06:24PM +0200, Martin Wilck wrote: > > On Thu, 2024-04-25 at 19:35 -0400, Benjamin Marzinski wrote: > > > > > > 1. create a multipath device with a kpartx partition on top of it &g

Re: [PATCH v2 2/5] libmultipath: change flush_on_last_del to fix a multipathd hang

2024-04-30 Thread Martin Wilck
On Thu, 2024-04-25 at 19:35 -0400, Benjamin Marzinski wrote: > > 1. create a multipath device with a kpartx partition on top of it and > no_path_retry set to either "queue" or something long enough to run > all > the commands in the reproducer before it disables queueing. > 2. disable all the

Re: [PATCH 0/3] multipath-tools: docs housekeeping

2024-04-30 Thread Martin Wilck
thd.8.in |  2 +- >  6 files changed, 13 insertions(+), 13 deletions(-) > > Cc: Martin Wilck > Cc: Benjamin Marzinski > Cc: Christophe Varoqui > Cc: DM-DEVEL ML > Signed-off-by: Xose Vazquez Perez For the series: Reviewed-by: Martin Wilck

Re: [PATCH 2/3] libmultipath: change flush_on_last_del to fix a multipathd hang

2024-04-25 Thread Martin Wilck
On Wed, 2024-04-24 at 16:42 -0400, Benjamin Marzinski wrote: > On Wed, Apr 24, 2024 at 06:34:35PM +0200, Martin Wilck wrote: > > On Tue, 2024-04-23 at 18:25 -0400, Benjamin Marzinski wrote: > > > > > > > > I chose "unused" as the default because t

Re: [PATCH 1/3] libmultipath: export partmap_in_use and do_deferred

2024-04-24 Thread Martin Wilck
On Tue, 2024-04-23 at 18:25 -0400, Benjamin Marzinski wrote: > A future commit will make use of these functions > > Signed-off-by: Benjamin Marzinski Reviewed-by: Martin Wilck > --- >  libmultipath/devmapper.c  | 4 +--- >  libmultipath/devmapper.h  | 3 +

Re: [PATCH 3/3] libmultipath: simplify dm_flush_map_nopaths

2024-04-24 Thread Martin Wilck
On Tue, 2024-04-23 at 18:25 -0400, Benjamin Marzinski wrote: > Now that flush_map_nopaths(), its only caller, needs to deal with > whether or not a remove is deferred, dm_flush_map_nopaths() > doesn't need to worry if LIBDM_API_DEFERRED is defined. It can just > trust that the caller took care of

Re: [PATCH 2/3] libmultipath: change flush_on_last_del to fix a multipathd hang

2024-04-24 Thread Martin Wilck
On Tue, 2024-04-23 at 18:25 -0400, Benjamin Marzinski wrote: > Commit 9bd3482e ("multipathd: make flush_map() delete maps like the > multipath command") Fixed an issue where deleting a queueing > multipath > device through multipathd could hang because the multipath device had > outstanding IO,

Re: [PATCH] scsi_lib: Align max_sectors to kb

2024-04-19 Thread Martin Wilck
(added Mike, Ben, and dm-devel) On Fri, 2024-04-19 at 08:20 +0200, Christoph Hellwig wrote: > On Thu, Apr 18, 2024 at 06:46:06PM +0200, Martin Wilck wrote: > > > Why would we?  It makes absolutly no sense to inherit these > > > limits, > > > the lower device will s

[PATCH 7/8] libmultipath: add wildcard %k for printing max_sectors_kb

2024-04-17 Thread Martin Wilck
Signed-off-by: Martin Wilck --- libmultipath/print.c | 38 ++ 1 file changed, 38 insertions(+) diff --git a/libmultipath/print.c b/libmultipath/print.c index 360308d..efd5a16 100644 --- a/libmultipath/print.c +++ b/libmultipath/print.c @@ -32,6 +32,7

[PATCH 8/8] multipath.conf(5): update documentation for max_sectors_kb

2024-04-17 Thread Martin Wilck
Signed-off-by: Martin Wilck --- multipath/multipath.conf.5.in | 33 + 1 file changed, 29 insertions(+), 4 deletions(-) diff --git a/multipath/multipath.conf.5.in b/multipath/multipath.conf.5.in index c788c18..b29a75f 100644 --- a/multipath/multipath.conf.5

[PATCH 6/8] libmultipath: set max_sectors_kb in adopt_paths()

2024-04-17 Thread Martin Wilck
current_mpp that represents the kernel state. We must still call sysfs_set_max_sectors_kb() from domap() in the ACT_CREATE case, because when adopt_paths is called from coalesce_paths() for a map that doesn't exist yet, mpp->max_sectors_kb is not set. Signed-off-by: Martin Wilck --- libmultip

[PATCH 1/8] multipath-tools: add TGTDIR option

2024-04-17 Thread Martin Wilck
TGTDIR is a convenience option for developers for building multipath-tools such that compiled-in paths of the plugins, config files, etc. match an installation under some optional path. See README.md for instructions and examples. Signed-off-by: Martin Wilck --- .github/actions/spelling

[PATCH 5/8] libmultipath: Only set max_sectors_kb on map creation

2024-04-17 Thread Martin Wilck
ould actually be possible in this situation, because stacked block devices are usually bio-based, and bio-based IO (in contrast to request-based) can be split if the lower-level device has can't handle the size of the I/O. Signed-off-by: Martin Wilck --- libmultipath/con

[PATCH 4/8] Revert "libmultipath: fix max_sectors_kb on adding path"

2024-04-17 Thread Martin Wilck
This reverts commit bbb77f318ee483292f50a7782aecaecc7e60f727. --- libmultipath/configure.c | 7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/libmultipath/configure.c b/libmultipath/configure.c index 89ac03d..13602f3 100644 --- a/libmultipath/configure.c +++

[PATCH 3/8] libmultipath: add mp_find_path_by_devt()

2024-04-17 Thread Martin Wilck
A helper function that searches a struct multipath by dev_t, and works whether or not mpp->paths is currently available. Signed-off-by: Martin Wilck --- libmultipath/structs.c | 19 +++ libmultipath/structs.h | 3 +++ 2 files changed, 22 insertions(+) diff --git a/libmultip

[PATCH 2/8] libmultipath: move get_udev_for_mpp to sysfs.c

2024-04-17 Thread Martin Wilck
No functional changes, just code movement. Signed-off-by: Martin Wilck --- libmultipath/configure.c | 20 libmultipath/sysfs.c | 19 +++ libmultipath/sysfs.h | 4 3 files changed, 23 insertions(+), 20 deletions(-) diff --git a/libmultipath

[PATCH 0/8] multipath-tools: max_sectors_kb rework

2024-04-17 Thread Martin Wilck
multipath is susceptible to errors caused by max_sectors_kb mismatch. If I am overlooking something here, please provide an example to prove me wrong. https://lore.kernel.org/dm-devel/7742003e19b5a49398067dc0c59dfa8ddeffc3d7.ca...@suse.com/ Martin Wilck (8): multipath-tools: add TGTDIR option li

[PATCH v2 2/2] multipath-tools tests: fix CI failures with clang on Fedora Rawhide

2024-04-16 Thread Martin Wilck
es because of wrong wrapper substitutions. Signed-off-by: Martin Wilck Reviewed-by: Benjamin Marzinski --- tests/dmevents.c | 6 ++--- tests/sysfs.c| 58 tests/test-lib.c | 6 ++--- tests/wrap64.h | 14 4 files changed, 49 inserti

[PATCH v2 1/2] multipath-tools tests: fix CI failures on arm/v7 with glibc 2.37

2024-04-16 Thread Martin Wilck
: set _FILE_OFFSET_BITS=64"). Note: the directio test with DIO_TEST_DEV for fails under qemu-linux-user with foreign-arch binfmt, because aio-related system calls are unsupported by qemu-linux-user. See https://gitlab.com/qemu-project/qemu/-/issues/210. Signed-off-by: Martin Wilck --- tests/direc

[PATCH v2 0/2] multipath-tools: CI fixes for glibc symbol substitutions

2024-04-16 Thread Martin Wilck
commit message for 1/2. Martin Wilck (2): multipath-tools tests: fix CI failures on arm/v7 with glibc 2.37 multipath-tools tests: fix CI failures with clang on Fedora Rawhide tests/directio.c | 28 +++ tests/dmevents.c | 6 ++--- t

Re: [PATCH v2] multipathd: Set CPUWeight to 1000 and LimitRTPRIO to 10

2024-04-16 Thread Martin Wilck
ased > priority. > > If multipathd did become a real time process, it set itself to the > highest priority, which is excessive. A priority of 10 is plenty. > > Signed-off-by: Benjamin Marzinski Reviewed-by: Martin Wilck > --- > > Notes: >     v2: Lowered LimitRTPRIO a

Re: [PATCH] multipathd: Set CPUWeight to 1000

2024-04-15 Thread Martin Wilck
ased > priority. > > Signed-off-by: Benjamin Marzinski > --- >  multipathd/multipathd.service.in | 1 + >  1 file changed, 1 insertion(+) Reviewed-by: Martin Wilck But let's also decrease the default value for LimitRTPRIO. Martin > > diff --git a/multipathd/multipathd.service.

Re: [PATCH 1/2] multipath-tools tests: fix CI failures on arm/v7 with glibc 2.37

2024-04-12 Thread Martin Wilck
On Fri, 2024-04-12 at 11:33 -0400, Benjamin Marzinski wrote: > On Fri, Apr 12, 2024 at 11:32:57AM +0200, Martin Wilck wrote: > >   > > -int __real_io_getevents(io_context_t ctx, long min_nr, long nr, > > +int REAL_IO_GETEVENTS(io_context_t ctx, long min_nr, long nr, > >

[PATCH 0/2] multipath-tools: CI fixes for glibc symbol substitutions

2024-04-12 Thread Martin Wilck
that only multipath-tools is affected by this problem. For now, here are patches that fix the recent CI regressions. Martin Wilck (2): multipath-tools tests: fix CI failures on arm/v7 with glibc 2.37 multipath-tools tests: fix CI failures with clang on Fedora Rawhide t

[PATCH 2/2] multipath-tools tests: fix CI failures with clang on Fedora Rawhide

2024-04-12 Thread Martin Wilck
es because of wrong wrapper substitutions. Signed-off-by: Martin Wilck --- tests/dmevents.c | 6 ++--- tests/sysfs.c| 58 tests/test-lib.c | 6 ++--- tests/wrap64.h | 14 4 files changed, 49 insertions(+), 35 deletions(-) diff --g

[PATCH 1/2] multipath-tools tests: fix CI failures on arm/v7 with glibc 2.37

2024-04-12 Thread Martin Wilck
: set _FILE_OFFSET_BITS=64"). Signed-off-by: Martin Wilck --- tests/directio.c | 22 +++--- tests/vpd.c | 35 ++- tests/wrap64.h | 23 ++- 3 files changed, 51 insertions(+), 29 deletions(-) diff --git a/tests/directio.c b/tests/

[PATCH] libmpathutil: really always use glibc basename()

2024-04-12 Thread Martin Wilck
om/opensvc/multipath-tools/pull/84 Signed-off-by: Martin Wilck Reviewed-by: Khem Raj Reviewed-by: Benjamin Marzinski --- mwilck: Already reviewed and queued, posting to dm-devel for information. --- libmpathutil/libmpathutil.version | 4 libmpathutil/util.c | 5 +

Re: Problem with [PATCH] libmultipath: fix max_sectors_kb on adding path

2024-04-12 Thread Martin Wilck
On Fri, 2024-04-12 at 08:06 +0200, Hannes Reinecke wrote: > > > We have gone into great pains in the kernel to ensure the queue > limits > are sane, and updated correctly. Even for stacking devices. This is true, but only for the creation of stacked devices (table activation, as far as device

Problem with [PATCH] libmultipath: fix max_sectors_kb on adding path

2024-04-11 Thread Martin Wilck
Hello Ben, hello Etienne, On Wed, 2023-08-23 at 21:51 +0200, Martin Wilck wrote: > On Wed, 2023-08-23 at 16:24 +, Etienne Aujames wrote: > > From: Etienne AUJAMES > > > > A user can change the value of max_sectors_kb on the multipath > > device > > and its

Re: [PATCH v2] multipathd: make multipathd set priority to RLIMIT_RTPRIO

2024-04-10 Thread Martin Wilck
Setting > LimitRTPRIO=0 will make multipathd run as a normal process, while > setting LimitRTPRIO=infinity will make it use the maximum SCHED_RR > prio, > which is 99. > > To keep the existing behavior, multipathd.service now sets > LimitRTPRIO=infinity > > Signed-off-by: Benjam

Re: [PATCH] multipathd: make multipathd set priority to RLIMIT_RTPRIO

2024-04-09 Thread Martin Wilck
On Tue, 2024-04-09 at 12:12 -0400, Benjamin Marzinski wrote: > On Tue, Apr 09, 2024 at 04:38:57PM +0200, Martin Wilck wrote: > > On Fri, 2024-03-29 at 14:28 -0400, Benjamin Marzinski wrote: > > > With this change, if the SCHED_RT_PRIO compiler flag is not set, > > > mul

Re: [PATCH] multipathd: make multipathd set priority to RLIMIT_RTPRIO

2024-04-09 Thread Martin Wilck
On Fri, 2024-03-29 at 14:28 -0400, Benjamin Marzinski wrote: > With this change, if the SCHED_RT_PRIO compiler flag is not set, > multipathd will call getrlimit(RLIMIT_RTPRIO, ...) and look at the > hard > limit. It it's 0, multipath will do nothing. Otherwise it will change > its scheduling

Re: [PATCH v3 00/12] multipath udev rules changes for dm rules V3

2024-04-09 Thread Martin Wilck
On Tue, 2024-04-09 at 16:08 +0200, Martin Wilck wrote: > This patch set adapts the multipath rules to the pending changes > for device mapper rules that update DM_UDEV_RULES_VSN to 3, and > applies some additional clean-ups to the rules files. > > Changes v2 -> v3: > * 0

[PATCH v3 00/12] multipath udev rules changes for dm rules V3

2024-04-09 Thread Martin Wilck
ome comments instead, lest I make the same mistake again. * 02/11: fix label name in comment to match an existing label * 04/11: added missing "\" at end of line Comments welcome. Martin Wilck (12): 11-dm-mpath.rules: explain logic for device becoming ready while suspended 11-dm

[PATCH v3 08/12] 11-dm-mpath.rules: replace DM_NOSCAN by .DM_NOSCAN

2024-04-09 Thread Martin Wilck
We don't need to restore DM_NOSCAN from the db anymore, so we can rename it to .DM_NOSCAN, making it a temporary property. Signed-off-by: Martin Wilck --- multipath/11-dm-mpath.rules.in | 9 ++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/multipath/11-dm-mpath.rules.in b

Re: [PATCH v2 08/11] 11-dm-mpath.rules: replace DM_NOSCAN by .DM_NOSCAN

2024-04-09 Thread Martin Wilck
On Mon, 2024-04-08 at 14:47 -0400, Benjamin Marzinski wrote: > >   > > +# device-mapper rules v2 compatibility for 13-dm-disk.rules > > +ENV{DM_UDEV_RULES_VSN}!="3", ENV{DM_NOSCAN}="$env{.DM_NOSCAN}" > > + > > You missed a DM_UDEV_RULES_VSN change here. Thanks! Martin

Re: [PATCH] kpartx: Add -N option to allow specifying a devmapping name

2024-04-05 Thread Martin Wilck
On Thu, 2024-04-04 at 19:23 -0500, Glenn Washburn wrote: > Running `kpartx -a disk.img` will create device names like > `/dev/mapper/loopNpM` where `N` and `M` are positive integers. The > issue is > that `loopN` is not known before hand. `losetup -f` can be used to > figure > out what the next

Re: [PATCH] README.md: Add libmount to list of build prerequisites

2024-04-05 Thread Martin Wilck
On Thu, 2024-04-04 at 19:14 -0500, Glenn Washburn wrote: > On Debian based systems the libmount development package (ie. > libmount-dev) > is required to build. Add it to the list in the README.md. > > Signed-off-by: Glenn Washburn Reviewed-by: Martin Wilck

[PATCH v2 08/11] 11-dm-mpath.rules: replace DM_NOSCAN by .DM_NOSCAN

2024-04-04 Thread Martin Wilck
We don't need to restore DM_NOSCAN from the db anymore, so we can rename it to .DM_NOSCAN, making it a temporary property. Signed-off-by: Martin Wilck --- multipath/11-dm-mpath.rules.in | 9 ++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/multipath/11-dm-mpath.rules.in b

[PATCH v2 11/11] kpartx.rules: ignore DM_SUSPENDED

2024-04-04 Thread Martin Wilck
DM_SUSPENDED=1 implies DM_UDEV_DISABLE_OTHER_RULES_FLAG=1, no need to check it again. The DM_NOSCAN check needs to remain in order to keep compatibility with dm rules v2. Signed-off-by: Martin Wilck Reviewed-by: Benjamin Marzinski --- kpartx/kpartx.rules | 2 +- 1 file changed, 1 insertion

[PATCH v2 09/11] 11-dm-mpath.rules: simplify PATH_FAILED case

2024-04-04 Thread Martin Wilck
This combination of a GOTO and a simple rule can be combined into a single rule. Signed-off-by: Martin Wilck Reviewed-by: Benjamin Marzinski --- multipath/11-dm-mpath.rules.in | 12 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/multipath/11-dm-mpath.rules.in b

[PATCH v2 10/11] 11-dm-mpath.rules: make label names more intuitive

2024-04-04 Thread Martin Wilck
The labels "dont_activate" and "scan_import" denote the same code line. Remove "dont_activate". Improve two misleading label names. Substitutions: dont_activate -> scan_import force_activation -> check_mpath_ready mpath_action -> check_mpath

[PATCH v2 07/11] 11-dm-mpath.rules: replace DM_SUSPENDED by .DM_SUSPENDED

2024-04-04 Thread Martin Wilck
to use .DM_SUSPENDED. In practice .DM_SUSPENDED is equivalent to DM_UDEV_DISABLE_OTHER_RULES_FLAG for multipath devices, but using .DM_SUSPENDED here makes the intention more obvious. Signed-off-by: Martin Wilck --- multipath/11-dm-mpath.rules.in | 13 - 1 file changed, 8 insertions

[PATCH v2 05/11] 11-dm-mpath.rules: adapt coldplug event handling ro 10-dm.rules update

2024-04-04 Thread Martin Wilck
of DM_SUSPENDED will be replaced in a follow-up patch). Signed-off-by: Martin Wilck --- multipath/11-dm-mpath.rules.in | 9 +++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/multipath/11-dm-mpath.rules.in b/multipath/11-dm-mpath.rules.in index 2f909c3..5f547ca 100644 --- a/multipath/11-dm

[PATCH v2 06/11] 11-dm-mpath.rules: don't import properties with new 13-dm-disk.rules

2024-04-04 Thread Martin Wilck
state"), included in lvm2 2.03.19, but we have no simple way to detect the version of the lvm2 rules. Signed-off-by: Martin Wilck --- multipath/11-dm-mpath.rules.in | 4 1 file changed, 4 insertions(+) diff --git a/multipath/11-dm-mpath.rules.in b/multipath/11-dm-mpath.rules.in index 5f547c

[PATCH v2 04/11] 11-dm-mpath.rules: adapt MPATH_DEVICE_READY=0 logic to 10-dm.rules update

2024-04-04 Thread Martin Wilck
With the late patches for 10-dm.rules, DM_UDEV_DISABLE_OTHER_RULES_FLAG isn't restored from the udev database any more, so we don't need to restore the flag to its original state before it is saved to the db. Signed-off-by: Martin Wilck --- multipath/11-dm-mpath.rules.in | 22

[PATCH v2 03/11] 11-dm-mpath.rules: don't import ID_FS_VERSION from udev db

2024-04-04 Thread Martin Wilck
Use the same set of properties to import as 13-dm-disk.rules. ID_FS_VERSION isn't used in any udev rule I am aware of. Signed-off-by: Martin Wilck Reviewed-by: Benjamin Marzinski --- multipath/11-dm-mpath.rules.in | 1 - 1 file changed, 1 deletion(-) diff --git a/multipath/11-dm

[PATCH v2 02/11] 11-dm-mpath.rules: don't import DM_NOSCAN from udev db

2024-04-04 Thread Martin Wilck
he "output" flags accordingly in the "force_activation" code path further down. Signed-off-by: Martin Wilck --- multipath/11-dm-mpath.rules.in | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/multipath/11-dm-mpath.rules.in b/multipath/11-dm-mpath.rules.in

[PATCH v2 00/11] multipath udev rules changes for dm rules V3

2024-04-04 Thread Martin Wilck
;\" at end of line Comments welcome. Martin Wilck (11): 11-dm-mpath.rules: explain logic for device becoming ready while suspended 11-dm-mpath.rules: don't import DM_NOSCAN from udev db 11-dm-mpath.rules: don't import ID_FS_VERSION from udev db 11-dm-mpath.rules: adapt MPATH_DE

[PATCH v2 01/11] 11-dm-mpath.rules: explain logic for device becoming ready while suspended

2024-04-04 Thread Martin Wilck
Add a comment to explain why we must set MPATH_DEVICE_READY=0 when we see a device becoming ready (number of active paths 0 -> 1) while the device is suspended. Signed-off-by: Martin Wilck --- multipath/11-dm-mpath.rules.in | 2 ++ 1 file changed, 2 insertions(+) diff --git a/multipath/11

Re: [PATCH 07/11] 11-dm-mpath.rules: replace DM_SUSPENDED by .DM_SUSPENDED

2024-04-04 Thread Martin Wilck
On Tue, 2024-03-26 at 19:36 -0400, Benjamin Marzinski wrote: > On Sun, Mar 24, 2024 at 10:12:57PM +0100, Martin Wilck wrote: > > With the late changes to the device mapper rules, DM_SUSPENDED > > is not exported any more. Use .DM_SUSPENDED instead. > > > > Note that

Re: [PATCH 01/11] 11-dm-mpath.rules: don't set MPATH_DEVICE_READY=0 for suspended devices

2024-04-04 Thread Martin Wilck
On Tue, 2024-03-26 at 17:52 -0400, Benjamin Marzinski wrote: > On Sun, Mar 24, 2024 at 10:12:51PM +0100, Martin Wilck wrote: > > MPATH_DEVICE_READY is an internal property, not to be consumed by > > later rules. It means that there are no usable paths. Being > > suspend

Re: [PATCH 02/11] 11-dm-mpath.rules: don't import DM_NOSCAN from udev db

2024-04-04 Thread Martin Wilck
On Tue, 2024-03-26 at 20:14 -0400, Benjamin Marzinski wrote: > On Tue, Mar 26, 2024 at 06:03:42PM -0400, Benjamin Marzinski wrote: > > On Sun, Mar 24, 2024 at 10:12:52PM +0100, Martin Wilck wrote: > > > DM_NOSCAN is our "output" flag for 13-dm-disk.rules, and it &

Re: [PATCH 04/11] 11-dm-mpath.rules: adapt MPATH_DEVICE_READY=0 logic to 10-dm.rules update

2024-04-04 Thread Martin Wilck
On Tue, 2024-03-26 at 18:17 -0400, Benjamin Marzinski wrote: > On Sun, Mar 24, 2024 at 10:12:54PM +0100, Martin Wilck wrote: > > > > +ENV{DM_UDEV_RULES_VSN}!="3", > > Can't we do something like: > > ENV{DM_UDEV_RULES_VSN}=="1|2", > > instea

[PATCH 10/11] 11-dm-mpath.rules: make label names more intuitive

2024-03-24 Thread Martin Wilck
The labels "dont_activate" and "scan_import" denote the same code line. Remove "dont_activate". Improve two misleading label names. Substitutions: dont_activate -> scan_import force_activation -> check_mpath_ready mpath_action -> check_mpath

[PATCH 09/11] 11-dm-mpath.rules: simplify PATH_FAILED case

2024-03-24 Thread Martin Wilck
This combination of a GOTO and a simple rule can be combined into a single rule. Signed-off-by: Martin Wilck --- multipath/11-dm-mpath.rules.in | 12 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/multipath/11-dm-mpath.rules.in b/multipath/11-dm-mpath.rules.in index

[PATCH 11/11] kpartx.rules: ignore DM_SUSPENDED

2024-03-24 Thread Martin Wilck
DM_SUSPENDED=1 implies DM_UDEV_DISABLE_OTHER_RULES_FLAG=1, no need to check it again. The DM_NOSCAN check needs to remain in order to keep compatibility with dm rules v2. Signed-off-by: Martin Wilck --- kpartx/kpartx.rules | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git

[PATCH 06/11] 11-dm-mpath.rules: don't import properties with new 13-dm-disk.rules

2024-03-24 Thread Martin Wilck
state"), included in lvm2 2.03.19, but we have no simple way to detect the version of the lvm2 rules. Signed-off-by: Martin Wilck --- multipath/11-dm-mpath.rules.in | 4 1 file changed, 4 insertions(+) diff --git a/multipath/11-dm-mpath.rules.in b/multipath/11-dm-mpath.rules.in index cf004f

[PATCH 07/11] 11-dm-mpath.rules: replace DM_SUSPENDED by .DM_SUSPENDED

2024-03-24 Thread Martin Wilck
to use .DM_SUSPENDED. In practice .DM_SUSPENDED is equivalent to DM_UDEV_DISABLE_OTHER_RULES_FLAG for multipath devices, but using .DM_SUSPENDED here makes the intention more obvious. Signed-off-by: Martin Wilck --- multipath/11-dm-mpath.rules.in | 13 - 1 file changed, 8 insertions

[PATCH 08/11] 11-dm-mpath.rules: replace DM_NOSCAN by .DM_NOSCAN

2024-03-24 Thread Martin Wilck
We don't need to restore DM_NOSCAN from the db anymore, so we can rename it to .DM_NOSCAN, making it a temporary property. Signed-off-by: Martin Wilck --- multipath/11-dm-mpath.rules.in | 9 ++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/multipath/11-dm-mpath.rules.in b

[PATCH 05/11] 11-dm-mpath.rules: adapt coldplug event handling ro 10-dm.rules update

2024-03-24 Thread Martin Wilck
of DM_SUSPENDED will be replaced in a follow-up patch). Signed-off-by: Martin Wilck --- multipath/11-dm-mpath.rules.in | 9 +++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/multipath/11-dm-mpath.rules.in b/multipath/11-dm-mpath.rules.in index 997e3e7..cf004fd 100644 --- a/multipath/11-dm

[PATCH 02/11] 11-dm-mpath.rules: don't import DM_NOSCAN from udev db

2024-03-24 Thread Martin Wilck
he "output" flags accordingly in the "force_activation" code path further down. Signed-off-by: Martin Wilck --- multipath/11-dm-mpath.rules.in | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/multipath/11-dm-mpath.rules.in b/multipath/11-dm-mpath.rules.in

[PATCH 04/11] 11-dm-mpath.rules: adapt MPATH_DEVICE_READY=0 logic to 10-dm.rules update

2024-03-24 Thread Martin Wilck
With the late patches for 10-dm.rules, DM_UDEV_DISABLE_OTHER_RULES_FLAG isn't restored from the udev database any more, so we don't need to restore the flag to its original state before it is saved to the db. Signed-off-by: Martin Wilck --- multipath/11-dm-mpath.rules.in | 20

[PATCH 03/11] 11-dm-mpath.rules: don't import ID_FS_VERSION from udev db

2024-03-24 Thread Martin Wilck
Use the same set of properties to import as 13-dm-disk.rules. ID_FS_VERSION isn't used in any udev rule I am aware of. Signed-off-by: Martin Wilck --- multipath/11-dm-mpath.rules.in | 1 - 1 file changed, 1 deletion(-) diff --git a/multipath/11-dm-mpath.rules.in b/multipath/11-dm

[PATCH 01/11] 11-dm-mpath.rules: don't set MPATH_DEVICE_READY=0 for suspended devices

2024-03-24 Thread Martin Wilck
MPATH_DEVICE_READY is an internal property, not to be consumed by later rules. It means that there are no usable paths. Being suspended is a different, independent property of a map. Don't set MPATH_DEVICE_READY=0 for suspended devices. Signed-off-by: Martin Wilck --- multipath/11-dm

[PATCH 00/11] multipath udev rules changes for dm rules V3

2024-03-24 Thread Martin Wilck
This patch set adapts the multipath rules to the pending changes for device mapper rules that update DM_UDEV_RULES_VSN to 3, and applies some additional clean-ups to the rules files. Comments welcome. Martin Wilck (11): 11-dm-mpath.rules: don't set MPATH_DEVICE_READY=0 for suspended

Re: [RFC Patch] dm: make sure to wait for all dispatched requests in __dm_suspend()

2024-03-20 Thread Martin Wilck
On Wed, 2024-03-20 at 11:03 +0800, Ming Lei wrote: > On Tue, Mar 19, 2024 at 04:41:26PM +0100, Martin Wilck wrote: > > > > What we know for sure is that there was a bad dm_target reference > > in > > (struct dm_rq_target_io *tio)->ti: > > > > crash&g

Re: [RFC Patch] dm: make sure to wait for all dispatched requests in __dm_suspend()

2024-03-19 Thread Martin Wilck
Mike, On Tue, 2024-03-19 at 12:53 -0400, Mike Snitzer wrote: > > While I appreciate you making us aware of this crash, I'm really not > interested in going down the rabbit hole of reasoning through fairly > complex concerns unless you have gotten your customer a kernel with > latest fixes (e.g.

Re: [RFC Patch] dm: make sure to wait for all dispatched requests in __dm_suspend()

2024-03-19 Thread Martin Wilck
Hello Ming, On Tue, 2024-03-19 at 21:04 +0800, Ming Lei wrote: > Hello Martin, > > On Sat, Mar 16, 2024 at 12:10:35AM +0100, Martin Wilck wrote: > > In a recent kernel dump analysis, we found that the kernel crashed > > because > > dm_rq_target_io tio->ti

[RFC Patch] dm: make sure to wait for all dispatched requests in __dm_suspend()

2024-03-15 Thread Martin Wilck
its memory effects, either before or after the synchronize_srcu(). In the first case, dm_wait_for_completion() will observe the in-flight status. Otherwise, dm_mq_queue_rq will see DMF_BLOCK_IO_FOR_SUSPEND and give up. In both cases, there will be no stale reference in tio->target when the request finishe

Re: [PATCH v2 0/7] device mapper udev rules rework

2024-03-05 Thread Martin Wilck
On Tue, 2024-03-05 at 15:42 +0100, Peter Rajnoha wrote: > > (You can also create an MR in lvm2's gitlab upstream repo > https://gitlab.com/lvmteam/lvm2 if you have an account there.) > > For the whole patchset: > Reviewed-by: Peter Rajnoha > https://gitlab.com/lvmteam/lvm2/-/merge_requests/9

[PATCH v2 7/7] 10-dm.rules: bump DM_UDEV_RULES_VSN to 3

2024-03-05 Thread Martin Wilck
. Signed-off-by: Martin Wilck --- udev/10-dm.rules.in | 12 +++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/udev/10-dm.rules.in b/udev/10-dm.rules.in index fccf3bc..0fb2033 100644 --- a/udev/10-dm.rules.in +++ b/udev/10-dm.rules.in @@ -12,6 +12,9 @@ # DM_NAME - actual

[PATCH v2 6/7] dm udev rules: don't export and save DM_NOSCAN

2024-03-05 Thread Martin Wilck
DM_NOSCAN is not an official API any more and doesn't have to be restored from the udev db. Rename it to .DM_NOSCAN. Signed-off-by: Martin Wilck --- udev/11-dm-lvm.rules.in | 2 +- udev/13-dm-disk.rules.in | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/udev/11-dm

[PATCH v2 5/7] dm udev rules: don't export and save DM_SUSPENDED

2024-03-05 Thread Martin Wilck
artx.rules (from multipath-tools) and 99-systemd.rules (from systemd). These will have to be adapted. 11-dm-mpath.rules will be changed to use .DM_SUSPENDED. Signed-off-by: Martin Wilck --- udev/10-dm.rules.in | 14 -- udev/12-dm-permissions.rules | 2 +- udev/13-dm-disk.rules.i

[PATCH v2 4/7] 11-dm-lvm.rules: don't restore DM_UDEV_DISABLE_OTHER_RULES_FLAG from db

2024-03-05 Thread Martin Wilck
r spurious. DM_SUBSYSTEM_UDEV_FLAG0 is just another flag that needs to be or'd in. We don't need to restore the previous state of DM_UDEV_DISABLE_OTHER_RULES_FLAG. Actually, doing so is wrong if the flag has previously been set because the device was suspended, and the device isn't suspended anymore. Signed-off-

[PATCH v2 3/7] 10-dm-rules: don't restore DM_UDEV_DISABLE_OTHER_RULES_FLAG from db

2024-03-05 Thread Martin Wilck
, but evaluated anew for every uevent. Therefore DM_UDEV_DISABLE_OTHER_RULES_FLAG shouldn't be restored, either. Use a new variable DM_COOKIE_DISABLE_OTHER_RULES_FLAG to save and restore the original value from the cookie. Signed-off-by: Martin Wilck --- udev/10-dm.rules.in | 12 ++-- 1 file changed

[PATCH v2 2/7] 10-dm.rules: test DISK_RO after importing properties

2024-03-05 Thread Martin Wilck
DISK_RO=1 and DISK_RO=0 events. Signed-off-by: Martin Wilck --- udev/10-dm.rules.in | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/udev/10-dm.rules.in b/udev/10-dm.rules.in index 4ffd3e2..f83fbec 100644 --- a/udev/10-dm.rules.in +++ b/udev/10-dm.rules.in @@ -50,9 +50,6

[PATCH v2 1/7] 13-dm-disk.rules: import ID_FS_TYPE

2024-03-05 Thread Martin Wilck
ID_FS_TYPE is the most important udev property for most follow-up rules. It must be imported from the udev db if blkid can't be run. Signed-off-by: Martin Wilck --- udev/13-dm-disk.rules.in | 1 + 1 file changed, 1 insertion(+) diff --git a/udev/13-dm-disk.rules.in b/udev/13-dm-disk.rules.in

[PATCH v2 0/7] device mapper udev rules rework

2024-03-05 Thread Martin Wilck
tps://lore.kernel.org/linux-lvm/9d50edb0-baa4-4a01-a2f0-136dfdb79...@redhat.com/T/#t Martin Wilck (7): 13-dm-disk.rules: import ID_FS_TYPE 10-dm.rules: test DISK_RO after importing properties 10-dm-rules: don't restore DM_UDEV_DISABLE_OTHER_RULES_FLAG from db 11-dm-lvm.rules: don't resto

Re: [RFC PATCH 5/7] dm udev rules: don't export and save DM_SUSPENDED

2024-03-05 Thread Martin Wilck
On Tue, 2024-03-05 at 10:10 +0100, Peter Rajnoha wrote: > On 3/5/24 09:47, Martin Wilck wrote: > > On Tue, 2024-03-05 at 09:19 +0100, Peter Rajnoha wrote: > > > Within DM and DM-subsystem rules, it's OK to use DM_SUSPENDED, if > > > needed. > > > > I gathe

Re: [RFC PATCH 7/7] 10-dm.rules: bump DM_UDEV_RULES_VSN to 3

2024-03-05 Thread Martin Wilck
On Tue, 2024-03-05 at 09:26 +0100, Peter Rajnoha wrote: > On 3/4/24 17:46, Martin Wilck wrote: > > On Mon, 2024-03-04 at 12:09 +0100, Peter Rajnoha wrote: > > > One thing that comes to my mind here is cooperation between the > > > rules > > > from initrd/initram

Re: [RFC PATCH 5/7] dm udev rules: don't export and save DM_SUSPENDED

2024-03-05 Thread Martin Wilck
On Tue, 2024-03-05 at 09:19 +0100, Peter Rajnoha wrote: > On 3/4/24 17:21, Martin Wilck wrote: > > > > My personal take on this is that 11-dm-mpath.rules actually belongs > > to > > device-mapper (being executed before 13-dm-disk.rules), even though > > it's not

  1   2   3   >