0 Star 0 Fork 40

wangjufeng/multipath-tools

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
9009-bugfix-lun-expansion-failure-when-there-is-offline-path.patch 1.68 KB
一键复制 编辑 原始数据 按行查看 历史
wangjufeng 提交于 2020-01-10 17:13 . rename the package
diff --git a/libmultipath/configure.c b/libmultipath/configure.c
index 1b1cc55..f66bd5b 100644
--- a/libmultipath/configure.c
+++ b/libmultipath/configure.c
@@ -1054,11 +1054,18 @@ int coalesce_paths (struct vectors * vecs, vector newmp, char * refwwid,
orphan_path(pp1, "only one path");
continue;
}
- /* if path is handled before */
- if (pp1->handled) {
- condlog(3, "%s: skip handled path.", pp1->dev_t);
- continue;
- }
+
+ /* if path is offline */
+ if (pp1->state == PATH_DOWN) {
+ orphan_path(pp1, "skip offline path");
+ continue;
+ }
+
+ /* if path is handled before */
+ if (pp1->handled) {
+ condlog(3, "%s: skip handled path.", pp1->dev_t);
+ continue;
+ }
/*
@@ -1086,6 +1093,9 @@ int coalesce_paths (struct vectors * vecs, vector newmp, char * refwwid,
if (strcmp(pp1->wwid, pp2->wwid))
continue;
+ if (!pp2->size || pp2->state == PATH_DOWN)
+ continue;
+
if (!mpp->size && pp2->size)
mpp->size = pp2->size;
diff --git a/libmultipath/structs_vec.c b/libmultipath/structs_vec.c
index d85eb5f..6c42824 100644
--- a/libmultipath/structs_vec.c
+++ b/libmultipath/structs_vec.c
@@ -394,8 +394,9 @@ int verify_paths(struct multipath *mpp, struct vectors *vecs)
/*
* see if path is in sysfs
*/
- if (sysfs_attr_get_value(pp->udev, "dev",
- pp->dev_t, BLK_DEV_SIZE) < 0) {
+ if ((sysfs_attr_get_value(pp->udev, "dev",
+ pp->dev_t, BLK_DEV_SIZE) < 0) ||
+ (pp->state == PATH_DOWN && pp->size != mpp->size)) {
if (pp->state != PATH_DOWN) {
condlog(1, "%s: removing valid path %s in state %d",
mpp->alias, pp->dev, pp->state);
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/wangjufeng/multipath-tools.git
git@gitee.com:wangjufeng/multipath-tools.git
wangjufeng
multipath-tools
multipath-tools
master

搜索帮助