From c153c54860a719d928b1c14e7c375312bf6f3074 Mon Sep 17 00:00:00 2001 From: xueyamao Date: Thu, 30 Oct 2025 16:31:48 +0800 Subject: [PATCH] libmpathpersist: set mpp->mpe before selecting reservation_key --- ...set-mpp-mpe-before-selecting-reserva.patch | 39 +++++++++++++++++++ multipath-tools.spec | 6 ++- 2 files changed, 44 insertions(+), 1 deletion(-) create mode 100644 0062-libmpathpersist-set-mpp-mpe-before-selecting-reserva.patch diff --git a/0062-libmpathpersist-set-mpp-mpe-before-selecting-reserva.patch b/0062-libmpathpersist-set-mpp-mpe-before-selecting-reserva.patch new file mode 100644 index 0000000..88f9dc5 --- /dev/null +++ b/0062-libmpathpersist-set-mpp-mpe-before-selecting-reserva.patch @@ -0,0 +1,39 @@ +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/mpath_persist.c | 8 ++++++++ + 1 file changed, 8 insertions(+) + +diff --git a/libmpathpersist/mpath_persist.c b/libmpathpersist/mpath_persist.c +index 7cbb299..8096e3e 100644 +--- a/libmpathpersist/mpath_persist.c ++++ b/libmpathpersist/mpath_persist.c +@@ -304,6 +304,7 @@ int __mpath_persistent_reserve_out ( int fd, int rq_servact, int rq_scope, + 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); +@@ -325,6 +326,13 @@ int __mpath_persistent_reserve_out ( int fd, int rq_servact, int rq_scope, + } + + 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 d16c3f4..eb5a95b 100644 --- a/multipath-tools.spec +++ b/multipath-tools.spec @@ -2,7 +2,7 @@ Name: multipath-tools Version: 0.8.4 -Release: 37 +Release: 38 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/ @@ -71,6 +71,7 @@ Patch58: 0058-libmultipath-set-clear-handled-flag-only-in-coalesce.patch Patch59: 0059-11-dm-mpath.rules-fix-warnings-reported-by-udevadm-v.patch Patch60: 0060-dm-parts.rules-fix-warning-reported-by-udevadm-verif.patch Patch61: 0061-libmultipath-fix-checker-detection-for-nvme-devices.patch +Patch62: 0062-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 @@ -219,6 +220,9 @@ fi %changelog +* Thu Oct 30 2025 xueyamao - 0.8.4-38 +- libmpathpersist: set mpp->mpe before selecting reservation_key + * Sat Oct 11 2025 xueyamao - 0.8.4-37 - libmultipath: fix checker detection for nvme devices -- Gitee