2020-07-16 18:51:36 +08:00
|
|
|
From ed732bcdc90162993e82df1bec8642aabb7a64a5 Mon Sep 17 00:00:00 2001
|
2020-01-10 17:13:17 +08:00
|
|
|
From: sunguoshuai <sunguoshuai@huawei.com>
|
|
|
|
|
Date: Wed, 23 Jan 2019 02:38:00 -0500
|
|
|
|
|
Subject: [PATCH] ignore for clear mismatch key
|
|
|
|
|
|
|
|
|
|
reason:ignore for clear mismatch key
|
|
|
|
|
---
|
|
|
|
|
libmpathpersist/mpath_persist.c | 17 +++++++++++------
|
|
|
|
|
1 file changed, 11 insertions(+), 6 deletions(-)
|
|
|
|
|
|
|
|
|
|
diff --git a/libmpathpersist/mpath_persist.c b/libmpathpersist/mpath_persist.c
|
2020-07-16 18:51:36 +08:00
|
|
|
index f9c3be9..027d006 100644
|
2020-01-10 17:13:17 +08:00
|
|
|
--- a/libmpathpersist/mpath_persist.c
|
|
|
|
|
+++ b/libmpathpersist/mpath_persist.c
|
2020-07-16 18:51:36 +08:00
|
|
|
@@ -309,7 +309,8 @@ int __mpath_persistent_reserve_out ( int fd, int rq_servact, int rq_scope,
|
2020-01-10 17:13:17 +08:00
|
|
|
if (mpp->prkey_source == PRKEY_SOURCE_FILE && prkey &&
|
|
|
|
|
((!get_be64(mpp->reservation_key) &&
|
|
|
|
|
rq_servact == MPATH_PROUT_REG_SA) ||
|
|
|
|
|
- rq_servact == MPATH_PROUT_REG_IGN_SA)) {
|
|
|
|
|
+ rq_servact == MPATH_PROUT_REG_IGN_SA ||
|
|
|
|
|
+ (!memcmp(paramp->key, &mpp->reservation_key, 8) && rq_servact == MPATH_PROUT_REG_SA))) {
|
|
|
|
|
memcpy(&mpp->reservation_key, paramp->sa_key, 8);
|
|
|
|
|
if (update_prkey_flags(alias, get_be64(mpp->reservation_key),
|
|
|
|
|
paramp->sa_flags)) {
|
2020-07-16 18:51:36 +08:00
|
|
|
@@ -326,12 +327,16 @@ int __mpath_persistent_reserve_out ( int fd, int rq_servact, int rq_scope,
|
2020-01-10 17:13:17 +08:00
|
|
|
uireservation >>= 8;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
- if (memcmp(paramp->key, uitmp, 8) &&
|
|
|
|
|
- memcmp(paramp->sa_key, uitmp, 8)) {
|
|
|
|
|
+ /* pass -I option */
|
|
|
|
|
+ if (rq_servact != MPATH_PROUT_REG_IGN_SA) {
|
|
|
|
|
+ if (memcmp(paramp->key, uitmp, 8) &&
|
|
|
|
|
+ memcmp(paramp->sa_key, uitmp, 8)) {
|
|
|
|
|
+ condlog(0, "%s: configured reservation key doesn't match: 0x%" PRIx64, alias, get_be64(mpp->reservation_key));
|
|
|
|
|
+ ret = MPATH_PR_SYNTAX_ERROR;
|
|
|
|
|
+ goto out1;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
|
|
|
|
|
- condlog(0, "%s: configured reservation key doesn't match: 0x%" PRIx64, alias, get_be64(mpp->reservation_key));
|
|
|
|
|
- ret = MPATH_PR_SYNTAX_ERROR;
|
|
|
|
|
- goto out1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
switch(rq_servact)
|
|
|
|
|
--
|
|
|
|
|
1.8.3.1
|
|
|
|
|
|