1 Star 0 Fork 40

liyunfei/multipath-tools

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
0005-fix-multipathd-resize-when-not-all-paths-size-are-eq.patch 1.43 KB
一键复制 编辑 原始数据 按行查看 历史
wangzhiqiang 提交于 2024-02-05 16:52 . upgrade version to 0.9.5
From 8e3c6debb3ed286f94af230f59a0fb9f6a449687 Mon Sep 17 00:00:00 2001
From: Lixiaokeng <lixiaokeng@huawei.com>
Date: Tue, 23 Nov 2021 20:14:23 +0800
Subject: [PATCH] fix multipathd resize when not all paths size are equal
---
multipathd/cli_handlers.c | 19 ++++++++++++++++++-
1 file changed, 18 insertions(+), 1 deletion(-)
diff --git a/multipathd/cli_handlers.c b/multipathd/cli_handlers.c
index 44bf43d..8b59d88 100644
--- a/multipathd/cli_handlers.c
+++ b/multipathd/cli_handlers.c
@@ -845,9 +845,10 @@ cli_resize(void *v, struct strbuf *reply, void *data)
char * mapname = get_keyparam(v, KEY_MAP);
struct multipath *mpp;
int minor;
- unsigned long long size;
+ unsigned long long size, sz;
struct pathgroup *pgp;
struct path *pp;
+ int i,j;
mapname = convert_dev(mapname, 0);
condlog(2, "%s: resize map (operator)", mapname);
@@ -885,6 +886,22 @@ cli_resize(void *v, struct strbuf *reply, void *data)
mapname);
return 1;
}
+
+ vector_foreach_slot (mpp->pg, pgp, i) {
+ vector_foreach_slot (pgp->paths, pp, j) {
+ if (!pp->udev || sysfs_get_size(pp, &sz)) {
+ condlog(0, "%s: couldn't get size for sysfs. cannot resize",
+ mapname);
+ return 1;
+ }
+ if (size != sz) {
+ condlog(0, "%s: not all path sizes are equal, please check. cannot resize",
+ mapname);
+ return 1;
+ }
+ }
+ }
+
if (size == mpp->size) {
condlog(0, "%s: map is still the same size (%llu)", mapname,
mpp->size);
--
2.33.0
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/liyunfei33/multipath-tools.git
git@gitee.com:liyunfei33/multipath-tools.git
liyunfei33
multipath-tools
multipath-tools
master

搜索帮助