Blame SOURCES/0049-mpathpersist-update-prkeys-file-on-changing-registra.patch

60b218
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
60b218
From: Benjamin Marzinski <bmarzins@redhat.com>
60b218
Date: Mon, 23 Nov 2020 20:45:50 -0600
60b218
Subject: [PATCH] mpathpersist: update prkeys file on changing registrations
60b218
60b218
When the "reservation_key" option is set to "file" and Register command
60b218
is run with both the current Reservation Key and a new Service Action
60b218
Reservation Key, mpathpersist will change the registration, but will not
60b218
update the prkeys file. This means that future paths that come online
60b218
will not be able to register, since multipathd is still using the old
60b218
reservation key. Fix this.
60b218
60b218
Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
60b218
---
60b218
 libmpathpersist/mpath_persist.c | 7 ++++---
60b218
 1 file changed, 4 insertions(+), 3 deletions(-)
60b218
60b218
diff --git a/libmpathpersist/mpath_persist.c b/libmpathpersist/mpath_persist.c
60b218
index aa196008..a01dfb0b 100644
60b218
--- a/libmpathpersist/mpath_persist.c
60b218
+++ b/libmpathpersist/mpath_persist.c
60b218
@@ -307,9 +307,10 @@ int __mpath_persistent_reserve_out ( int fd, int rq_servact, int rq_scope,
60b218
 
60b218
 	memcpy(&prkey, paramp->sa_key, 8);
60b218
 	if (mpp->prkey_source == PRKEY_SOURCE_FILE && prkey &&
60b218
-	    ((!get_be64(mpp->reservation_key) &&
60b218
-	      rq_servact == MPATH_PROUT_REG_SA) ||
60b218
-	     rq_servact == MPATH_PROUT_REG_IGN_SA)) {
60b218
+	    (rq_servact == MPATH_PROUT_REG_IGN_SA ||
60b218
+	     (rq_servact == MPATH_PROUT_REG_SA &&
60b218
+	      (!get_be64(mpp->reservation_key) ||
60b218
+	       memcmp(paramp->key, &mpp->reservation_key, 8) == 0)))) {
60b218
 		memcpy(&mpp->reservation_key, paramp->sa_key, 8);
60b218
 		if (update_prkey_flags(alias, get_be64(mpp->reservation_key),
60b218
 				       paramp->sa_flags)) {
60b218
-- 
60b218
2.17.2
60b218