Blame SOURCES/0048-mpathpersist-Fix-Register-and-Ignore-with-0x00-SARK.patch

b7337d
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
b7337d
From: Benjamin Marzinski <bmarzins@redhat.com>
b7337d
Date: Thu, 5 Nov 2020 09:15:43 -0600
b7337d
Subject: [PATCH] mpathpersist: Fix Register and Ignore with 0x00 SARK
b7337d
b7337d
When the Register and Ignore command is run with sg_persist, if a 0x00
b7337d
Service Action Reservation Key is given or the --param-sark option is
b7337d
not used at all, sg_persist will clear the registration.  mpathpersist
b7337d
will fail with an error.  This patch fixes mpathpersist to work like
b7337d
sg_persist in this case.
b7337d
b7337d
Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
b7337d
---
b7337d
 libmpathpersist/mpath_persist.c | 3 ++-
b7337d
 1 file changed, 2 insertions(+), 1 deletion(-)
b7337d
b7337d
diff --git a/libmpathpersist/mpath_persist.c b/libmpathpersist/mpath_persist.c
b7337d
index 3da7a6cf..aa196008 100644
b7337d
--- a/libmpathpersist/mpath_persist.c
b7337d
+++ b/libmpathpersist/mpath_persist.c
b7337d
@@ -321,7 +321,8 @@ int __mpath_persistent_reserve_out ( int fd, int rq_servact, int rq_scope,
b7337d
 	}
b7337d
 
b7337d
 	if (memcmp(paramp->key, &mpp->reservation_key, 8) &&
b7337d
-	    memcmp(paramp->sa_key, &mpp->reservation_key, 8)) {
b7337d
+	    memcmp(paramp->sa_key, &mpp->reservation_key, 8) &&
b7337d
+	    (prkey || rq_servact != MPATH_PROUT_REG_IGN_SA)) {
b7337d
 		condlog(0, "%s: configured reservation key doesn't match: 0x%" PRIx64, alias, get_be64(mpp->reservation_key));
b7337d
 		ret = MPATH_PR_SYNTAX_ERROR;
b7337d
 		goto out1;
b7337d
-- 
b7337d
2.17.2
b7337d