diff --git a/0029-libmpathpersist-set-mpp-mpe-before-selecting-reserva.patch b/0029-libmpathpersist-set-mpp-mpe-before-selecting-reserva.patch new file mode 100644 index 0000000000000000000000000000000000000000..2c58cfba3b7fe6a84e20d9230529142bf63720f4 --- /dev/null +++ b/0029-libmpathpersist-set-mpp-mpe-before-selecting-reserva.patch @@ -0,0 +1,55 @@ +From db1e72679bf1ba04b75f93936272b5a420918359 Mon Sep 17 00:00:00 2001 +From: Benjamin Marzinski +Date: Wed, 24 Jul 2024 14:17:12 -0400 +Subject: [PATCH] libmpathpersist: set mpp->mpe before selecting + reservation_key + +libmpathpersist was not setting mpp->mpe before calling +select_reservation_key(). This means that if the reservation key was set +in the multipaths sections, it wasn't being selected. + +This appeared to work for many commands because of an error in checking +if the correct reservation key was used. If mpp->reservation key was +unset, then it would considered to match if either the RK or SARK was +unset in the command. mpathpersist should fail if it doesn't find a +configured mpp->resevation key, with one exception. To make it easier to +remove old keys, if --register-ignore is called, and the command SARK is +0x0 so the device is being unregistered, allow mpp->reservation_key to +be unset. The code already allows mpp->reservation_key to not match the +command RK in this case. + +Signed-off-by: Benjamin Marzinski +Reviewed-by: Martin Wilck +--- + libmpathpersist/mpath_persist_int.c | 8 ++++++++ + 1 file changed, 8 insertions(+) + +diff --git a/libmpathpersist/mpath_persist_int.c b/libmpathpersist/mpath_persist_int.c +index d88499a..e3c2137 100644 +--- a/libmpathpersist/mpath_persist_int.c ++++ b/libmpathpersist/mpath_persist_int.c +@@ -666,6 +666,7 @@ int do_mpath_persistent_reserve_out(vector curmp, vector pathvec, int fd, + return ret; + + conf = get_multipath_config(); ++ mpp->mpe = find_mpe(conf->mptable, mpp->wwid); + select_reservation_key(conf, mpp); + select_all_tg_pt(conf, mpp); + put_multipath_config(conf); +@@ -687,6 +688,13 @@ int do_mpath_persistent_reserve_out(vector curmp, vector pathvec, int fd, + } + + uireservation = get_be64(mpp->reservation_key); ++ ++ if (!uireservation && ++ (prkey || rq_servact != MPATH_PROUT_REG_IGN_SA)) { ++ condlog(0, "%s: no configured reservation key", mpp->alias); ++ return MPATH_PR_SYNTAX_ERROR; ++ } ++ + for (j = 7; j >= 0; --j) { + uitmp[j] = (uireservation & 0xff); + uireservation >>= 8; +-- +2.43.0 + diff --git a/multipath-tools.spec b/multipath-tools.spec index d8841769dc9e848c30e7f0433c80cff26ce016eb..7bd45948ea4e25a0dff2a80598adc74b4c8c1ad0 100644 --- a/multipath-tools.spec +++ b/multipath-tools.spec @@ -1,7 +1,7 @@ #needsrootforbuild Name: multipath-tools Version: 0.9.5 -Release: 13 +Release: 14 Summary: Tools to manage multipath devices with the device-mapper License: GPL-2.0-or-later and LGPL-2.0-only URL: http://christophe.varoqui.free.fr/ @@ -37,6 +37,7 @@ Patch25: 0025-add-missing-include-for-cmocka.patch Patch26: 0026-Revert-multipathd-Fixed-multipathd-parameter-invokin.patch Patch27: 0027-11-dm-mpath.rules-fix-warnings-reported-by-udevadm-v.patch Patch28: 0028-dm-parts.rules-fix-warning-reported-by-udevadm-verif.patch +Patch29: 0029-libmpathpersist-set-mpp-mpe-before-selecting-reserva.patch BuildRequires: multipath-tools, libcmocka, libcmocka-devel BuildRequires: gcc, libaio-devel, userspace-rcu-devel, device-mapper-devel >= 1.02.89 @@ -186,6 +187,9 @@ fi %changelog +* Fri Oct 17 2025 xueyamao - 0.9.5-14 +- libmpathpersist: set mpp->mpe before selecting reservation_key + * Tue Sep 30 2025 xueyamao - 0.9.5-13 - fix warnings reported by udevadm verify