1 Star 0 Fork 40

lijie345/multipath-tools

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
0012-bugfix-ignore-for-clear-mismatch-key.patch 1.97 KB
一键复制 编辑 原始数据 按行查看 历史
lixiaokeng 提交于 2020-07-16 18:51 . update to 0.8.4
From ed732bcdc90162993e82df1bec8642aabb7a64a5 Mon Sep 17 00:00:00 2001
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
index f9c3be9..027d006 100644
--- a/libmpathpersist/mpath_persist.c
+++ b/libmpathpersist/mpath_persist.c
@@ -309,7 +309,8 @@ int __mpath_persistent_reserve_out ( int fd, int rq_servact, int rq_scope,
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)) {
@@ -326,12 +327,16 @@ int __mpath_persistent_reserve_out ( int fd, int rq_servact, int rq_scope,
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
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/lijie345/multipath-tools.git
git@gitee.com:lijie345/multipath-tools.git
lijie345
multipath-tools
multipath-tools
master

搜索帮助