From: mwilck@suse.com
To: Christophe Varoqui <christophe.varoqui@opensvc.com>,
Benjamin Marzinski <bmarzins@redhat.com>
Cc: dm-devel@redhat.com, Martin Wilck <mwilck@suse.com>
Subject: [dm-devel] [PATCH v2 00/37] multipath-tools: user-friendly names rework
Date: Mon, 11 Sep 2023 18:38:09 +0200 [thread overview]
Message-ID: <20230911163846.27197-1-mwilck@suse.com> (raw)
From: Martin Wilck <mwilck@suse.com>
This patch set contains a two-step rework of the user-friendly
names code. Patch 2-5 change the current code such that it (well, almost)
never attempts to use an alias that is currently in use by another
map. We already have some checks for this, but they don't cover all
possible scenarios. Patch 6-10 add some units tests for
get_user_friendly_alias(), and restructure the unit tests somewhat.
In the second part of the set, Patch 11-18 restructure the alias code such
that we don't read the bindings file every time an alias is
requested. Instead, we just use a memory cache of the current bindings, and
re-write the file only if a new binding is added. This reduces the number of
system calls and simplifies the code.
Patch 19 applies the changes to the unit tests that become
necessary because of the previous patches. Patch 20/21 add another
optimization for the alias_already_taken() test.
Patch 22-23 introduce a solution for the problem discussed in the review
of v1 of this patch set, the partial ordering of aliases in memory.
By sorting first be string length, and then alphabetically, we obtain
a total "numeric" ordering for every given alias prefix. This ordering
allows simplifying the search for "gaps" in the list of aliases, which
is done in patch 24-26.
As discussed in the opening letter of the v1 patch series, the patch
series has the effect that the bindings file is not re-read every time
a new binding is attempted. Patch 28 and 29 introduce a notification
mechanism for multipathd which causes the bindings to be re-read
when the bindings file has been updated.
Patch 30-36 are a series of minor fixes for the build system and the
documentation. Most imporantly, the man pages will now show the correct
paths for various built-in defaults.
Finally, patch 37 (which is deliberately kept separate and at the end of the
series, in order to allow downstream integrators to skip it) eventually
deprecates the runtime configuration options for bindings_file, wwids_file,
and prkeys_file.
Patch 1 is a separate, independent fix.
NOTE: my main test bed is currently unavailable, therefore this set has
yet reveived less testing than usual. I have tested this to the extent
I currently can, but further testing will be highly appreciated.
Reviews and comments welcome.
# Changes wrt v1 - v2:
* Patch 03: skipped superfluous test for the case where a map already
has an alias (Ben Marzinski)
* Patch 07: removed invalid tests for the case where the already assigned
alias of a given map is assigned to a different wwid (Ben Marzinski)
* Patch 09/10: moved some macro-usage fixes from 10 to 09
* Patch 18:
- skipped superfluous tests like in patch 03 (Ben Marzinski)
- fix bug in get_user_friendly_wwid() (Ben Marzinski)
* Added patch 22 ff. (see above).
Martin Wilck (37):
libmultipath: sysfs_set_scsi_tmo: do nothing for ACT_DRY_RUN
libmultipath: add alias_already_taken()
libmultipath: unify use_existing_alias() and get_user_friendly_alias()
libmultipath: never allocate an alias that's already taken
libmultipath: lookup_binding: add comment about the algorithm
multipath-tools test: simplify debugging for condlog mismatch
multipath-tools tests: add tests for get_user_friendly_alias()
multipath-tools test: consistent use of macros in alias test
multipath-tools tests: convert mock_{failed,used}_alias to macros
multipath-tools test: use mock_bindings_file() consistently
libmultipath: add global variable for current bindings
libmultipath: rename fix_bindings_file() to update_bindings_file()
libmultipath: alias.c: move bindings related code up
libmultipath: update_bindings_file: take filename argument
libmultipath: update_bindings_file: use a single write()
libmultipath: update_bindings_file: don't log temp file name
libmultipath: alias.c: factor out read_binding()
libmultipath: keep bindings in memory
multipath-tools tests: fix alias tests
libmultipath: dm_get_uuid(): return emtpy UUID for non-existing maps
libmultipath: adapt to new semantics of dm_get_uuid()
libmultipath: sort aliases by length and strcmp
multipath-tools tests: fix alias test after sort order change
libmultipath: simplify get_free_id() assuming total ordering
multipath-tools tests: adapt alias tests for total ordering
multipath-tools tests: add test for ordering of bindings
multipathd: watch bindings file with inotify + timestamp
multipath-tools tests: mock pthread_mutex_{lock,unlock}
multipath-tools Makefile: sanitize paths for configuration files
multipath-tools: add compile time configuration for "/etc/multipath"
multipath-tools man pages: generate with correct paths
libdmmp/Makefile: fix bug in install section
multipath-tools: README.md: improve documentation for compile-time
options
libmultipath: print built-in values for deprecated options
multipath: add a missing newline
multipath-tools: allow prefixes with and w/o trailing slash
libmultipath: deprecate bindings_file, wwids_file, prkeys_file
.gitignore | 4 +
Makefile.inc | 43 +-
README.md | 38 +-
libdmmp/Makefile | 2 +-
libmultipath/alias.c | 1042 +++++++-----
libmultipath/alias.h | 14 +-
libmultipath/config.c | 18 -
libmultipath/config.h | 3 -
libmultipath/configure.c | 7 +-
libmultipath/defaults.h | 7 +-
libmultipath/devmapper.c | 10 +-
libmultipath/dict.c | 55 +-
libmultipath/discovery.c | 3 +
libmultipath/libmultipath.version | 4 +-
libmultipath/prkey.c | 7 +-
libmultipath/prkey.h | 7 +-
libmultipath/propsel.c | 20 +-
libmultipath/wwids.c | 18 +-
mpathpersist/Makefile | 5 +-
.../{mpathpersist.8 => mpathpersist.8.in} | 2 +-
multipath/Makefile | 13 +-
multipath/main.c | 6 +-
multipath/{multipath.8 => multipath.8.in} | 10 +-
.../{multipath.conf.5 => multipath.conf.5.in} | 44 +-
multipathd/Makefile | 9 +-
multipathd/main.c | 1 +
multipathd/{multipathd.8 => multipathd.8.in} | 8 +-
multipathd/uxlsnr.c | 29 +-
tests/Makefile | 1 +
tests/alias.c | 1491 +++++++++++++----
tests/test-log.c | 4 +-
31 files changed, 1961 insertions(+), 964 deletions(-)
rename mpathpersist/{mpathpersist.8 => mpathpersist.8.in} (99%)
rename multipath/{multipath.8 => multipath.8.in} (97%)
rename multipath/{multipath.conf.5 => multipath.conf.5.in} (98%)
rename multipathd/{multipathd.8 => multipathd.8.in} (97%)
--
2.42.0
--
dm-devel mailing list
dm-devel@redhat.com
https://listman.redhat.com/mailman/listinfo/dm-devel
next reply other threads:[~2023-09-11 16:39 UTC|newest]
Thread overview: 68+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-09-11 16:38 mwilck [this message]
2023-09-11 16:38 ` [dm-devel] [PATCH v2 01/37] libmultipath: sysfs_set_scsi_tmo: do nothing for ACT_DRY_RUN mwilck
2023-09-11 16:38 ` [dm-devel] [PATCH v2 02/37] libmultipath: add alias_already_taken() mwilck
2023-09-12 22:59 ` Benjamin Marzinski
2023-09-11 16:38 ` [dm-devel] [PATCH v2 03/37] libmultipath: unify use_existing_alias() and get_user_friendly_alias() mwilck
2023-09-11 16:38 ` [dm-devel] [PATCH v2 04/37] libmultipath: never allocate an alias that's already taken mwilck
2023-09-12 23:00 ` Benjamin Marzinski
2023-09-11 16:38 ` [dm-devel] [PATCH v2 05/37] libmultipath: lookup_binding: add comment about the algorithm mwilck
2023-09-11 16:38 ` [dm-devel] [PATCH v2 06/37] multipath-tools test: simplify debugging for condlog mismatch mwilck
2023-09-11 16:38 ` [dm-devel] [PATCH v2 07/37] multipath-tools tests: add tests for get_user_friendly_alias() mwilck
2023-09-12 23:00 ` Benjamin Marzinski
2023-09-11 16:38 ` [dm-devel] [PATCH v2 08/37] multipath-tools test: consistent use of macros in alias test mwilck
2023-09-11 16:38 ` [dm-devel] [PATCH v2 09/37] multipath-tools tests: convert mock_{failed, used}_alias to macros mwilck
2023-09-11 16:38 ` [dm-devel] [PATCH v2 10/37] multipath-tools test: use mock_bindings_file() consistently mwilck
2023-09-11 16:38 ` [dm-devel] [PATCH v2 11/37] libmultipath: add global variable for current bindings mwilck
2023-09-11 16:38 ` [dm-devel] [PATCH v2 12/37] libmultipath: rename fix_bindings_file() to update_bindings_file() mwilck
2023-09-11 16:38 ` [dm-devel] [PATCH v2 13/37] libmultipath: alias.c: move bindings related code up mwilck
2023-09-11 16:38 ` [dm-devel] [PATCH v2 14/37] libmultipath: update_bindings_file: take filename argument mwilck
2023-09-11 16:38 ` [dm-devel] [PATCH v2 15/37] libmultipath: update_bindings_file: use a single write() mwilck
2023-09-11 16:38 ` [dm-devel] [PATCH v2 16/37] libmultipath: update_bindings_file: don't log temp file name mwilck
2023-09-11 16:38 ` [dm-devel] [PATCH v2 17/37] libmultipath: alias.c: factor out read_binding() mwilck
2023-09-11 16:38 ` [dm-devel] [PATCH v2 18/37] libmultipath: keep bindings in memory mwilck
2023-09-12 23:00 ` Benjamin Marzinski
2023-09-11 16:38 ` [dm-devel] [PATCH v2 19/37] multipath-tools tests: fix alias tests mwilck
2023-09-12 22:02 ` Benjamin Marzinski
2023-09-11 16:38 ` [dm-devel] [PATCH v2 20/37] libmultipath: dm_get_uuid(): return emtpy UUID for non-existing maps mwilck
2023-09-11 16:38 ` [dm-devel] [PATCH v2 21/37] libmultipath: adapt to new semantics of dm_get_uuid() mwilck
2023-09-11 16:38 ` [dm-devel] [PATCH v2 22/37] libmultipath: sort aliases by length and strcmp mwilck
2023-09-12 23:00 ` Benjamin Marzinski
2023-09-13 13:53 ` Martin Wilck
2023-09-13 14:38 ` Benjamin Marzinski
2023-09-13 19:07 ` Martin Wilck
2023-09-13 23:15 ` Benjamin Marzinski
2023-09-11 16:38 ` [dm-devel] [PATCH v2 23/37] multipath-tools tests: fix alias test after sort order change mwilck
2023-09-12 23:01 ` Benjamin Marzinski
2023-09-11 16:38 ` [dm-devel] [PATCH v2 24/37] libmultipath: simplify get_free_id() assuming total ordering mwilck
2023-09-12 22:59 ` Benjamin Marzinski
2023-09-11 16:38 ` [dm-devel] [PATCH v2 25/37] multipath-tools tests: adapt alias tests for " mwilck
2023-09-12 23:01 ` Benjamin Marzinski
2023-09-11 16:38 ` [dm-devel] [PATCH v2 26/37] multipath-tools tests: add test for ordering of bindings mwilck
2023-09-12 23:05 ` Benjamin Marzinski
2023-09-12 23:20 ` Benjamin Marzinski
2023-09-13 14:05 ` Martin Wilck
2023-09-11 16:38 ` [dm-devel] [PATCH v2 27/37] multipathd: watch bindings file with inotify + timestamp mwilck
2023-09-13 22:07 ` Benjamin Marzinski
2023-09-14 13:25 ` Martin Wilck
2023-09-14 14:28 ` Martin Wilck
2023-09-14 15:00 ` Benjamin Marzinski
2023-09-11 16:38 ` [dm-devel] [PATCH v2 28/37] multipath-tools tests: mock pthread_mutex_{lock, unlock} mwilck
2023-09-13 22:18 ` Benjamin Marzinski
2023-09-11 16:38 ` [dm-devel] [PATCH v2 29/37] multipath-tools Makefile: sanitize paths for configuration files mwilck
2023-09-13 22:30 ` Benjamin Marzinski
2023-09-11 16:38 ` [dm-devel] [PATCH v2 30/37] multipath-tools: add compile time configuration for "/etc/multipath" mwilck
2023-09-13 22:32 ` Benjamin Marzinski
2023-09-11 16:38 ` [dm-devel] [PATCH v2 31/37] multipath-tools man pages: generate with correct paths mwilck
2023-09-13 22:44 ` Benjamin Marzinski
2023-09-11 16:38 ` [dm-devel] [PATCH v2 32/37] libdmmp/Makefile: fix bug in install section mwilck
2023-09-13 22:46 ` Benjamin Marzinski
2023-09-11 16:38 ` [dm-devel] [PATCH v2 33/37] multipath-tools: README.md: improve documentation for compile-time options mwilck
2023-09-13 22:58 ` Benjamin Marzinski
2023-09-11 16:38 ` [dm-devel] [PATCH v2 34/37] libmultipath: print built-in values for deprecated options mwilck
2023-09-13 23:05 ` Benjamin Marzinski
2023-09-11 16:38 ` [dm-devel] [PATCH v2 35/37] multipath: add a missing newline mwilck
2023-09-13 23:05 ` Benjamin Marzinski
2023-09-11 16:38 ` [dm-devel] [PATCH v2 36/37] multipath-tools: allow prefixes with and w/o trailing slash mwilck
2023-09-13 23:09 ` Benjamin Marzinski
2023-09-11 16:38 ` [dm-devel] [PATCH v2 37/37] libmultipath: deprecate bindings_file, wwids_file, prkeys_file mwilck
2023-09-13 23:13 ` Benjamin Marzinski
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230911163846.27197-1-mwilck@suse.com \
--to=mwilck@suse.com \
--cc=bmarzins@redhat.com \
--cc=christophe.varoqui@opensvc.com \
--cc=dm-devel@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox