Skip to content

multipath-tools: Handle tableless DM devices

Benjamin Marzinski dm-devel 3 versions – New

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest12 patches 0 repliesNew
  2. v213 patches 7 repliesSuperseded
  3. v16 patches 15 repliesSuperseded

Changes in v3 from the cover letter

0008: Fixed commit message
0009 & 0010: merged. All future patch number are one less then their
previous number.
0011 & 0012: Fixed commit messages

Patches in v3 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/12libmultipath: signal device with no table in libmp_mapinfolibmultipath/devmapper.c libmultipath/devmapper.h+10 -30 replies
2/12multipath-tools tests: fix mapinfo teststests/mapinfo.c+43 -60 replies
3/12libmultipath: fix removing device after failed creationlibmultipath/devmapper.c libmultipath/devmapper.h+5 -30 replies
4/12libmultipath: set uuid, name, and dmi if a device is foundlibmultipath/devmapper.c libmultipath/devmapper.h libmultipath/structs_vec.c +1 more+63 -390 replies
5/12libmultipath: check table type in dm_find_map_by_wwidlibmultipath/devmapper.c multipathd/cli_handlers.c+8 -20 replies
6/12libmultipath: handle a create corner case for empty deviceslibmultipath/configure.c+20 -10 replies
7/12libmultipath: handle empty maps in dm_flush_map__libmultipath/devmapper.c+7 -20 replies
8/12libmultipath: factor out code to check if a device is a partitionlibmultipath/devmapper.c+29 -280 replies
9/12libmultipath: remove recursive calls in partmap_funcslibmultipath/devmapper.c+31 -280 replies
10/12libmultipath: assume device is in use if dm_get_opencount failslibmultipath/devmapper.c+5 -00 replies
11/12libmultipath: accept empty partitions as valid in do_foreach_partmapslibmultipath/devmapper.c+17 -70 replies
12/12libmultipath: reduce log level for DMP_NOT_FOUNDlibmultipath/devmapper.c+1 -10 replies

Reviews trailers per patch

8 of 12 patches have a Reviewed-by or Acked-by.

PatchMartin Wilck
1/12R-b
2/12
3/12R-b
4/12R-b
5/12R-b
6/12
7/12R-b
8/12
9/12
10/12R-b
11/12R-b
12/12R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v3 thread

Cover letter [PATCH v3 00/12] multipath-tools: Handle tableless DM devices

This is another stab at handling tableless multipath devices. The first two patches are reworkings of two patches from my last patchset based on feedback from Martin. The rest are new.

libmp_mapinfo now has a new return value, DMP_EMPTY, for devices that don't have any table. The creation failure path is fixed to check for this value before removing a device after a failed create, instead of just removing any existing DM device with the same name.

libmp_mapinfo now also always fills in info.name, info.uuid and info.dmi if requested, whenever a device is found, even if it returns DMP_NO_MATCH, DMP_EMPTY, or DMP_ERR. dm_find_map_by_wwid() uses this, as well as MAPINFO_MPATH_ONLY, to only return DM_OK for valid multipath devices, but to return the alias of any device that matches the uuid, even if it's not a valid multipath device.

domap() has been updated to use dm_find_map_by_wwid() to check for any DM device that matches the WWID of the device to be created. This lets it handle tableless devices that share the WWID of the device to be created but not its alias. Previously, multipath would fail attempting to create these devices. Now it correctly renames and reloads them when running multipath, starting or reloading multipathd, or running "multipathd add map".

Finally, dm_flush_map__() and do_foreach_partmaps() also handle tabless devices. So multipath -F will remove tabless multipath devices, as well as tableless partition devices on top of multipath devices (tabless or not). I cleanup up a number of minor issues while working on this.

Changes from v2 (based on suggestions from Martin Wilck):
0008: Fixed commit message
0009 & 0010: merged. All future patch number are one less then their
previous number.
0011 & 0012: Fixed commit messages

Changes from v1 (based on discussions with Martin Wilck):
0004: Dropped the flag. libmp_mapinfo now always fills in uuid, name, and
dmi if a device was found and they are non-NULL.
0005: Adapt to the changes in 0004
0007-0013: New patches to handle tabless devices in dm_flush_map__() and
do_foreach_partmaps(), as well as some minor fixes/cleanups I encountered along the way.

Benjamin Marzinski (11):
libmultipath: signal device with no table in libmp_mapinfo
libmultipath: fix removing device after failed creation
libmultipath: set uuid, name, and dmi if a device is found
libmultipath: check table type in dm_find_map_by_wwid
libmultipath: handle a create corner case for empty devices
libmultipath: handle empty maps in dm_flush_map__
libmultipath: factor out code to check if a device is a partition
libmultipath: remove recursive calls in partmap_funcs
libmultipath: assume device is in use if dm_get_opencount fails
libmultipath: accept empty partitions as valid in do_foreach_partmaps
libmultipath: reduce log level for DMP_NOT_FOUND

Martin Wilck (1):
multipath-tools tests: fix mapinfo tests

 libmultipath/configure.c   |  21 +++-
 libmultipath/devmapper.c   | 212 +++++++++++++++++++++----------------
 libmultipath/devmapper.h   |  13 ++-
 libmultipath/structs_vec.c |   5 +-
 multipathd/cli_handlers.c  |   8 +-
 tests/mapinfo.c            |  92 ++++++++++++----
 6 files changed, 235 insertions(+), 116 deletions(-)
Signature · 1 line
2.46.2