Re: [dm-devel] [PATCH v2 26/37] multipath-tools tests: add test for ordering of bindings

2023-09-12 Thread Benjamin Marzinski
On Mon, Sep 11, 2023 at 06:38:35PM +0200, mwi...@suse.com wrote: > From: Martin Wilck > > As the assignment of free aliases now relies on the bindings being > properly sorted, add some unit tests to make sure the sorting algorithm > works. On second thought... > --- > tests/alias.c | 212

Re: [dm-devel] [PATCH v2 26/37] multipath-tools tests: add test for ordering of bindings

2023-09-12 Thread Benjamin Marzinski
On Mon, Sep 11, 2023 at 06:38:35PM +0200, mwi...@suse.com wrote: > From: Martin Wilck > > As the assignment of free aliases now relies on the bindings being > properly sorted, add some unit tests to make sure the sorting algorithm > works. Missing a Signed-off-by, but otherwise Reviewed-by:

Re: [dm-devel] [PATCH v2 25/37] multipath-tools tests: adapt alias tests for total ordering

2023-09-12 Thread Benjamin Marzinski
On Mon, Sep 11, 2023 at 06:38:34PM +0200, mwi...@suse.com wrote: > From: Martin Wilck > > The "unsorted" test fail now, and are removed. The algorithm is now > better at finding "gaps". > Reviewed-by: Benjamin Marzinski > Signed-off-by: Martin Wilck > --- > tests/alias.c | 88

Re: [dm-devel] [PATCH v2 23/37] multipath-tools tests: fix alias test after sort order change

2023-09-12 Thread Benjamin Marzinski
On Mon, Sep 11, 2023 at 06:38:32PM +0200, mwi...@suse.com wrote: > From: Martin Wilck > Reviewed-by: Benjamin Marzinski > Signed-off-by: Martin Wilck > --- > tests/alias.c | 30 -- > 1 file changed, 12 insertions(+), 18 deletions(-) > > diff --git a/tests/alias.c

Re: [dm-devel] [PATCH v2 18/37] libmultipath: keep bindings in memory

2023-09-12 Thread Benjamin Marzinski
On Mon, Sep 11, 2023 at 06:38:27PM +0200, mwi...@suse.com wrote: > From: Martin Wilck > > Rather than opening the bindings file every time we must retrieve > a binding, keep the contents in memory and write the file only > if additions have been made. This simplifies the code, and should speed

Re: [dm-devel] [PATCH v2 22/37] libmultipath: sort aliases by length and strcmp

2023-09-12 Thread Benjamin Marzinski
On Mon, Sep 11, 2023 at 06:38:31PM +0200, mwi...@suse.com wrote: > From: Martin Wilck > > The current sort order of aliases is alphabetical, which is does not match > the actual order of aliases, where "mpathaa" > "mpathz". Change the ordering > as > follows: first sort by string length, then

Re: [dm-devel] [PATCH v2 07/37] multipath-tools tests: add tests for get_user_friendly_alias()

2023-09-12 Thread Benjamin Marzinski
On Mon, Sep 11, 2023 at 06:38:16PM +0200, mwi...@suse.com wrote: > From: Martin Wilck > Reviewed-by: Benjamin Marzinski > Signed-off-by: Martin Wilck > --- > tests/alias.c | 441 ++ > 1 file changed, 441 insertions(+) > > diff --git

Re: [dm-devel] [PATCH v2 04/37] libmultipath: never allocate an alias that's already taken

2023-09-12 Thread Benjamin Marzinski
On Mon, Sep 11, 2023 at 06:38:13PM +0200, mwi...@suse.com wrote: > From: Martin Wilck > > If the bindings file is changed in a way that multipathd can't handle > (e.g. by swapping the aliases of two maps), multipathd must not try > to re-use an alias that is already used by another map. Creating

Re: [dm-devel] [PATCH v2 02/37] libmultipath: add alias_already_taken()

2023-09-12 Thread Benjamin Marzinski
On Mon, Sep 11, 2023 at 06:38:11PM +0200, mwi...@suse.com wrote: > From: Martin Wilck > > Factor out a trivial helper function. > Reviewed-by: Benjamin Marzinski > Signed-off-by: Martin Wilck > --- > libmultipath/alias.c | 32 +++- > 1 file changed, 19

Re: [dm-devel] [PATCH v2 24/37] libmultipath: simplify get_free_id() assuming total ordering

2023-09-12 Thread Benjamin Marzinski
On Mon, Sep 11, 2023 at 06:38:33PM +0200, mwi...@suse.com wrote: > From: Martin Wilck > > If we can assume that the bindings array is totally ordered for every > prefix, which the previous patch guarantees, the search for a free ID can be > simplified. > Reviewed-by: Benjamin Marzinski >

Re: [dm-devel] [PATCH v2 19/37] multipath-tools tests: fix alias tests

2023-09-12 Thread Benjamin Marzinski
On Mon, Sep 11, 2023 at 06:38:28PM +0200, mwi...@suse.com wrote: > From: Martin Wilck > > The different implementation of get_user_friendly_alias() and its helpers > necessitates changes in the unit tests. It would be nice if it didn't, but the > unit tests are too closely bound to the

[dm-devel] [PATCH] dm: remove dm_set_md_type()

2023-09-12 Thread Li Lingfeng
Commit ba30585936b0 ("dm: move setting md->type into dm_setup_md_queue") has removed the only reference to dm_set_md_type(), so remove dm_set_md_type() now. Signed-off-by: Li Lingfeng --- drivers/md/dm.c | 6 -- drivers/md/dm.h | 1 - 2 files changed, 7 deletions(-) diff --git

Re: [dm-devel] [PATCH] fix writing to the filesystem after unmount

2023-09-12 Thread Jan Kara
On Fri 08-09-23 12:51:03, Zdenek Kabelac wrote: > Dne 08. 09. 23 v 12:20 Jan Kara napsal(a): > > On Fri 08-09-23 11:29:40, Zdenek Kabelac wrote: > > > Dne 08. 09. 23 v 9:32 Jan Kara napsal(a): > > > > On Thu 07-09-23 14:04:51, Mikulas Patocka wrote: > > > > > On Thu, 7 Sep 2023, Christian Brauner

[dm-devel] [PATCH v2 27/37] multipathd: watch bindings file with inotify + timestamp

2023-09-12 Thread mwilck
From: Martin Wilck Since "libmultipath: keep bindings in memory", we don't re-read the bindings file after every modification. Add a notification mechanism that makes multipathd aware of changes to the bindings file. Because multipathd itself will change the bindings file, it must compare