[dm-devel] [PATCH 0/2] libmutipath: only give out free user_friendly_names

Benjamin Marzinski bmarzins at redhat.com
Wed Mar 10 21:15:13 UTC 2021


This patchset fixes a bug that we're run into on installation. Right
now, multipath doesn't ever check that the user_friendly_name it
selected is actually not in-use.  Normally, this is fine, since it won't
pick a name without first adding it to the bindings file.  However, if
the device was created in the initramfs, the bindings file in the
regular filesystem won't be updated until multipathd processes those
paths when starting up after the switchroot. If new path devices are
discovered when multipath starts up after the switchroot, they could be
processed first, and pick the already in use user_friendly_name. In this
case multipath will fail back to using the WWID for the new device, and
renaming the old device.  Later, if multipathd is reconfigured, the new
device will get renamed to the previously in-use user_friendly_name it
added to the bindings file.  All this renaming of devices is messing
with the installer.

To deal with this, this patchset checks that the selected alias is not
in use by an existing dm device, before writing it to the bindings file.
If it is, multipath just steps through the free aliases in the bindings
file, checking until it finds a one that's not in use. I've updated the
lookup_binding() tests to test this functionality as well.

Benjamin Marzinski (2):
  libmultipath: check if user_friendly_name is in use
  tests: add tests for checking if alias is in use

 libmultipath/alias.c |  48 ++++-
 tests/alias.c        | 427 +++++++++++++++++++++++++++++++++++++++++--
 2 files changed, 459 insertions(+), 16 deletions(-)

-- 
2.17.2




More information about the dm-devel mailing list