1 Star 0 Fork 32

hantwofish/gazelle_1

forked from src-openEuler/gazelle 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
0184-EPOLL-fix-coredump-while-event-count-exceed-maxevent.patch 1.60 KB
一键复制 编辑 原始数据 按行查看 历史
From e3c12e9d73678b3c5445f770c929e035ef1c4997 Mon Sep 17 00:00:00 2001
From: yinbin6 <yinbin8@huawei.com>
Date: Fri, 7 Jun 2024 11:13:08 +0800
Subject: [PATCH] EPOLL: fix coredump while event count exceed maxevents
---
src/lstack/api/lstack_epoll.c | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/src/lstack/api/lstack_epoll.c b/src/lstack/api/lstack_epoll.c
index c8a2e43..28a3dd9 100644
--- a/src/lstack/api/lstack_epoll.c
+++ b/src/lstack/api/lstack_epoll.c
@@ -488,7 +488,14 @@ int32_t epoll_lwip_event_nolock(struct wakeup_poll *wakeup, struct epoll_event *
list_del_node_null(node);
continue;
}
-
+
+ if (event_num >= maxevents) {
+ /* move list head after the current node, and start traversing from this node next time */
+ list_del_node_null(&wakeup->event_list);
+ list_add_node(node, &wakeup->event_list);
+ break;
+ }
+
events[event_num].events = sock->events & sock->epoll_events;
events[event_num].data = sock->ep_data;
event_num++;
@@ -504,13 +511,6 @@ int32_t epoll_lwip_event_nolock(struct wakeup_poll *wakeup, struct epoll_event *
list_del_node_null(node);
sock->epoll_events = 0;
}
-
- if (event_num >= maxevents) {
- /* move list head after the current node, and start traversing from this node next time */
- list_del_node_null(&wakeup->event_list);
- list_add_node(node, &wakeup->event_list);
- break;
- }
}
return event_num;
--
2.33.0
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/hantwofish/gazelle_1.git
git@gitee.com:hantwofish/gazelle_1.git
hantwofish
gazelle_1
gazelle_1
master

搜索帮助