On Mon, 2025-09-08 at 19:59 -0400, Benjamin Marzinski wrote:
> The mpathpersist code has many areas where it does a poor job of
> mimicking the behavior of setting up persistent reservations on an
> individual device, especially if paths to the multipath device are
> missing or unusable. This patchset is aimed at fixing a number of
> them. It is a combination of my two previous patchsets:
> [PATCH 00/15] Improve mpathpersist's unavailable path handling
> and
> [PATCH 00/14] Additional fixes and cleanups
> along with additional patches.
> 
> Issues handled by the patchset are:
> - Changing or unregistering a key held by an unavailable path that
> also
>   holds the reservation. This is done by preempting the old key
>   (after verifying that the multipath device is holding the
> reservation)
> - Releasing a reservation held by an unavailable path. This has
> always
>   had code to handle it, but it relied on optional Persistent
>   Reservation features. The new code preempts the key and then
> restores
>   the removed registered keys (while the device is suspended).
> - Handling removal of keys from paths that were down when the
> multipath
>   device was unregistered.
> - Changing how conflicts on key registration are handled. Instead of
>   the current rollback method (which was broken anyways),
>   libmpathpersist now retries with REGISTER AND IGNORE as long as the
>   REGISTER command completed successfully down some of the paths.
> - Changing when the reservation key is set to fix corner cases on
>   failure and registration while paths are coming up.
> - Retrying on conflicts in mpath_prout_common to fix corner cases
> when
>   a path is coming up while a doing a reserve, preempt or clear.
> - Allowing registrations to succeed when there are retryable errors, 
>   if the paths are actually down.
> - Fixing the reservation key validation code
> 
> Changes in V2:
> 
> First set (as suggested by Martin Wilck)
> 0009: Added a comment explaining the select_skip_kpartx()
> 0010: use all_threads_fail variable instead of rc.
> 
> Second set
> 0003 (now 0018): Remove noisy variable from update_map_pr
> 0007 (new 0022): Added comment explaining why we won't fail syntax
> error
>      checks after updating the reservation key, as suggested by
> Martin
>      Wilck (for patch 0012, but it made more sense to change it here)
> 
> 0030 new patch to not attempt workaround when a release fails due to
> a
>      mismatched type.
> 0031 new patch to fix an issue with issuing a RESERVE command to the
>      path that doesn't hold the reservation.
> 0032 new patch to fix an issue with a multipath device preempting its
>      own reservation key.
> 
> Benjamin Marzinski (32):
>   multipathd: remove thread from mpath_pr_event_handle
>   libmpathpersist: remove uneeded wrapper function.
>   libmpathpersist: reduce log level for persistent reservation
> checking
>   libmpathpersist: remove pointless update_map_pr ret value code
>   multipathd: use update_map_pr in mpath_pr_event_handle
>   libmpathpersist: limit changing prflag in update_map_pr
>   multipathd: Don't call update_map_pr unnecessarily
>   libmpathpersist: remove useless function send_prout_activepath
>   libmpathpersist: redesign failed release workaround
>   libmpathpersist: fail the release if all threads fail
>   libmpathpersist: Handle changing key corner case
>   libmpathpersist: Handle REGISTER AND IGNORE changing key corner
> case
>   libmultipath: rename prflag_value enums
>   libmpathpersist: use a switch statement for prout command
> finalizing
>   libmpathpersist: Add safety check for preempting on key change
>   libmpathpersist: remove update_map_pr code for NULL pp
>   libmpathpersist: move update_map_pr to multipathd
>   multipathd: clean up update_map_pr and mpath_pr_event_handle
>   libmpathpersist: clean up duplicate function declarations
>   multipathd: wrap setting and unsetting prflag
>   multipathd: unregister PR key when path is restored if necessary
>   libmpathpersist: Fix-up reservation_key checking
>   libmpathpersist: change how reservation conflicts are handled
>   libmpathpersist: Clear prkey in multipathd before unregistering
>   libmpathpersist: only clear the key if we are using the prkeys file
>   libmpathpersist: Restore old reservation key on failure
>   libmpathpersist: update reservation key before checking paths
>   libmpathpersist: retry on conflicts in mpath_prout_common
>   libmpathpersist: Don't always fail registrations for retryable
> errors
>   libmpathpersist: Don't try release workaround for invalid type
>   libmpathpersist: Don't fail RESERVE commands unnecessarily
>   libmpathpersist: reregister keys when self preempting
> 
>  libmpathpersist/libmpathpersist.version |   3 +-
>  libmpathpersist/mpath_persist_int.c     | 817 ++++++++++++++--------
> --
>  libmpathpersist/mpath_persist_int.h     |   4 +-
>  libmpathpersist/mpath_pr_ioctl.c        |  12 +-
>  libmpathpersist/mpath_updatepr.c        |  74 ++-
>  libmpathpersist/mpathpr.h               |   3 +
>  libmultipath/libmultipath.version       |   1 +
>  libmultipath/structs.h                  |  12 +-
>  mpathpersist/main.c                     |   2 -
>  multipathd/callbacks.c                  |   3 +
>  multipathd/cli.c                        |   4 +-
>  multipathd/cli.h                        |   3 +
>  multipathd/cli_handlers.c               |  66 +-
>  multipathd/main.c                       | 237 ++++---
>  multipathd/main.h                       |   2 +
>  15 files changed, 755 insertions(+), 488 deletions(-)

For the series:

Reviewed-by: Martin Wilck <[email protected]>


Reply via email to