8 Star 0 Fork 5

src-anolis-os/glusterfs

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
0320-gf-event-Handle-unix-volfile-servers.patch 2.08 KB
一键复制 编辑 原始数据 按行查看 历史
geliwei 提交于 2021-06-16 16:09 . update to glusterfs-6.0-49.1.el8.src.rpm
From 7e5d8dcb4f557eaca259e8d81cf34d651907396c Mon Sep 17 00:00:00 2001
From: Pranith Kumar K <[email protected]>
Date: Thu, 24 Oct 2019 12:24:35 +0530
Subject: [PATCH 320/335] gf-event: Handle unix volfile-servers
Problem:
glfsheal program uses unix-socket-based volfile server.
volfile server will be the path to socket in this case.
gf_event expects this to be hostname in all cases. So getaddrinfo
will fail on the unix-socket path, events won't be sent in this case.
Fix:
In case of unix sockets, default to localhost
upstream-patch: https://review.gluster.org/c/glusterfs/+/23606
BUG: 1758923
Change-Id: I60d27608792c29d83fb82beb5fde5ef4754bece8
Signed-off-by: Pranith Kumar K <[email protected]>
Reviewed-on: https://code.engineering.redhat.com/gerrit/185851
Tested-by: RHGS Build Bot <[email protected]>
Reviewed-by: Sunil Kumar Heggodu Gopala Acharya <[email protected]>
---
libglusterfs/src/events.c | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/libglusterfs/src/events.c b/libglusterfs/src/events.c
index 9d33783..4e2f8f9 100644
--- a/libglusterfs/src/events.c
+++ b/libglusterfs/src/events.c
@@ -43,6 +43,7 @@ _gf_event(eventtypes_t event, const char *fmt, ...)
struct addrinfo *result = NULL;
xlator_t *this = THIS;
int sin_family = AF_INET;
+ char *volfile_server_transport = NULL;
/* Global context */
ctx = THIS->ctx;
@@ -62,8 +63,16 @@ _gf_event(eventtypes_t event, const char *fmt, ...)
memset(&hints, 0, sizeof(hints));
hints.ai_family = AF_UNSPEC;
+ if (ctx) {
+ volfile_server_transport = ctx->cmd_args.volfile_server_transport;
+ }
+
+ if (!volfile_server_transport) {
+ volfile_server_transport = "tcp";
+ }
/* Get Host name to send message */
- if (ctx && ctx->cmd_args.volfile_server) {
+ if (ctx && ctx->cmd_args.volfile_server &&
+ (strcmp(volfile_server_transport, "unix"))) {
/* If it is client code then volfile_server is set
use that information to push the events. */
if ((getaddrinfo(ctx->cmd_args.volfile_server, NULL, &hints,
--
1.8.3.1
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/src-anolis-os/glusterfs.git
[email protected]:src-anolis-os/glusterfs.git
src-anolis-os
glusterfs
glusterfs
a8

搜索帮助