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

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