mbox series

[v2,00/18] change how multipathd deletes maps plus cleanups

Message ID 20240103175643.18438-1-bmarzins@redhat.com (mailing list archive)
Headers show
Series change how multipathd deletes maps plus cleanups | expand

Message

Benjamin Marzinski Jan. 3, 2024, 5:56 p.m. UTC
The main purpose of this patchset is to make multipathd call
dm_suspend_and_flush_map() for the "del map" and "del maps" interactive
commands. I ran into an issue where if there was outstanding IO to a
queueing multipath device, dm_flush_map() would hang removing the last
kpartx device, since that would close the last opener of the multipath
device, forcing it to wait for the IO to flush. This is avoided by
dm_suspend_and_flush_map(), since it disables queueing first. The first
three patches do this. The next three are cleanups around removing a
device. The rest of the patches are make multipath return better errors
when it delegates removes since it doesn't need to failback to doing its
own removes anymore, make libdmmp handle failures from running
multipathd commands better, and make multipath and multipathc return
proper error codes when multipathd commands fail.

Differences from v1 (based on suggestions by Martin Wilck)
0003: simplify dm_flush_maps(), since all callers set need_suspend
0005: Minor change in dm_flush_maps() to accomodate change in 0003. I
      retained the reviewed-by.
0007: Stripped the initial "fail\n" off messages with additional failure
      information.
0009: Minor changes in dm_flush_maps() and its callers to accomodate
      change in 0003. I retained the reviewed-by.
0010: changed the log level of the error message to 2.
0012: search for path by dev_t first, and change the log level of the
      error message to 2.
0015: Minor change to calling dm_flush_maps() to accomodate change in
      0003. I retained the reviewed-by
0016: multipath repeatedly calls delegate_to_multipathd for all
      remove_retries, instead of failing back to locally calling remove.
0017: New patch based on patch 0016 discussion.
0018: New patch to deal with a issue caused by the change to track the
      queue_if_no_path state in mpp->features, from my previous
      patchset.

Benjamin Marzinski (18):
  multipathd: remove nopath flushing code from flush_map()
  multipathd: make flush_map() delete maps like the multipath command
  multipathd: disable queueing when removing unknown maps
  multipathd: simplify cli_del_map()
  libmultipath: make _dm_flush_map() return an enum
  libmultipath: make dm_remove_partmaps() a static function
  multipathd: always start failure replies with "fail\n"
  multipathd: print extra default reply msg for busy devices
  multipathd: handle busy devices in cli_del_maps()
  libmultipath: print error when find_mp_by_str() fails.
  multipathd: don't open code find_mp_by_str() in client handers
  multipathd: make cli_handlers check for paths by dev and devt
  multipathd: add cli_handler reply message for missing devs
  libdmmp: handle failures in _process_cmd
  multipath: get rid of unnecessary retries variable
  multipath: Don't locally retry deletgated remove failures
  multipath: if delegation times out mark as not delegated
  multipathd: sync features on flush_map failure corner case

 libdmmp/libdmmp.c                 |  71 +++++-------
 libmultipath/devmapper.c          |  47 ++++----
 libmultipath/devmapper.h          |  13 ++-
 libmultipath/libmultipath.version |   3 +-
 libmultipath/structs.c            |   9 +-
 multipath/main.c                  |  72 +++++++-----
 multipathd/cli_handlers.c         | 182 ++++++++++++++----------------
 multipathd/main.c                 |  70 ++++--------
 multipathd/main.h                 |   3 +-
 multipathd/uxclnt.c               |   9 +-
 multipathd/uxlsnr.c               |  15 ++-
 11 files changed, 241 insertions(+), 253 deletions(-)

Comments

Martin Wilck Jan. 5, 2024, 3:25 p.m. UTC | #1
On Wed, 2024-01-03 at 12:56 -0500, Benjamin Marzinski wrote:
> The main purpose of this patchset is to make multipathd call
> dm_suspend_and_flush_map() for the "del map" and "del maps"
> interactive
> commands. I ran into an issue where if there was outstanding IO to a
> queueing multipath device, dm_flush_map() would hang removing the
> last
> kpartx device, since that would close the last opener of the
> multipath
> device, forcing it to wait for the IO to flush. This is avoided by
> dm_suspend_and_flush_map(), since it disables queueing first. The
> first
> three patches do this. The next three are cleanups around removing a
> device. The rest of the patches are make multipath return better
> errors
> when it delegates removes since it doesn't need to failback to doing
> its
> own removes anymore, make libdmmp handle failures from running
> multipathd commands better, and make multipath and multipathc return
> proper error codes when multipathd commands fail.
> 
> Differences from v1 (based on suggestions by Martin Wilck)
> 0003: simplify dm_flush_maps(), since all callers set need_suspend
> 0005: Minor change in dm_flush_maps() to accomodate change in 0003. I
>       retained the reviewed-by.
> 0007: Stripped the initial "fail\n" off messages with additional
> failure
>       information.
> 0009: Minor changes in dm_flush_maps() and its callers to accomodate
>       change in 0003. I retained the reviewed-by.
> 0010: changed the log level of the error message to 2.
> 0012: search for path by dev_t first, and change the log level of the
>       error message to 2.

The commit message still says "make cli_handlers check for paths by dev
and devt". I'll take the freedom to change this to the actual ordering.

> 0015: Minor change to calling dm_flush_maps() to accomodate change in
>       0003. I retained the reviewed-by

You didn't, actually. I'll re-add it.

> 0016: multipath repeatedly calls delegate_to_multipathd for all
>       remove_retries, instead of failing back to locally calling
> remove.
> 0017: New patch based on patch 0016 discussion.
> 0018: New patch to deal with a issue caused by the change to track
> the
>       queue_if_no_path state in mpp->features, from my previous
>       patchset.
> 
> Benjamin Marzinski (18):
>   multipathd: remove nopath flushing code from flush_map()
>   multipathd: make flush_map() delete maps like the multipath command
>   multipathd: disable queueing when removing unknown maps
>   multipathd: simplify cli_del_map()
>   libmultipath: make _dm_flush_map() return an enum
>   libmultipath: make dm_remove_partmaps() a static function
>   multipathd: always start failure replies with "fail\n"
>   multipathd: print extra default reply msg for busy devices
>   multipathd: handle busy devices in cli_del_maps()
>   libmultipath: print error when find_mp_by_str() fails.
>   multipathd: don't open code find_mp_by_str() in client handers
>   multipathd: make cli_handlers check for paths by dev and devt
>   multipathd: add cli_handler reply message for missing devs
>   libdmmp: handle failures in _process_cmd
>   multipath: get rid of unnecessary retries variable
>   multipath: Don't locally retry deletgated remove failures
>   multipath: if delegation times out mark as not delegated
>   multipathd: sync features on flush_map failure corner case
> 
>  libdmmp/libdmmp.c                 |  71 +++++-------
>  libmultipath/devmapper.c          |  47 ++++----
>  libmultipath/devmapper.h          |  13 ++-
>  libmultipath/libmultipath.version |   3 +-
>  libmultipath/structs.c            |   9 +-
>  multipath/main.c                  |  72 +++++++-----
>  multipathd/cli_handlers.c         | 182 ++++++++++++++--------------
> --
>  multipathd/main.c                 |  70 ++++--------
>  multipathd/main.h                 |   3 +-
>  multipathd/uxclnt.c               |   9 +-
>  multipathd/uxlsnr.c               |  15 ++-
>  11 files changed, 241 insertions(+), 253 deletions(-)

For the set:

Reviewed-by: Martin Wilck <mwilck@suse.com>