0 Star 0 Fork 40

wangjufeng/multipath-tools

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
6007-multipathd-check-for-NULL-udevice-in-cli_add_path.patch 1.07 KB
一键复制 编辑 原始数据 按行查看 历史
wangjufeng 提交于 2020-01-10 17:13 . rename the package
From e7a3324274578d63cdef23bb08410df20e0de862 Mon Sep 17 00:00:00 2001
From: Benjamin Marzinski <bmarzins@redhat.com>
Date: Wed, 10 Oct 2018 13:01:09 -0500
Subject: [PATCH] multipathd: check for NULL udevice in cli_add_path
If cli_add_path can't get a udevice for the path, it should fail
immediately, instead of continuing with a NULL udevice, since it will
fail in store_pathinfo() anyway.
Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
---
multipathd/cli_handlers.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/multipathd/cli_handlers.c b/multipathd/cli_handlers.c
index bb164726..75000807 100644
--- a/multipathd/cli_handlers.c
+++ b/multipathd/cli_handlers.c
@@ -720,6 +720,10 @@ cli_add_path (void * v, char ** reply, int * len, void * data)
udevice = udev_device_new_from_subsystem_sysname(udev,
"block",
param);
+ if (!udevice) {
+ condlog(0, "%s: can't find path", param);
+ return 1;
+ }
conf = get_multipath_config();
pthread_cleanup_push(put_multipath_config, conf);
r = store_pathinfo(vecs->pathvec, conf,
--
2.11.0
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/wangjufeng/multipath-tools.git
git@gitee.com:wangjufeng/multipath-tools.git
wangjufeng
multipath-tools
multipath-tools
master

搜索帮助