代码拉取完成,页面将自动刷新
同步操作将从 src-openEuler/gazelle 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
From ef98d32ed9dbde08412c8d4587bfeb7a6e75ec7c Mon Sep 17 00:00:00 2001
From: wu-changsheng <wuchangsheng2@huawei.com>
Date: Sun, 9 Oct 2022 20:21:40 +0800
Subject: [PATCH] fix stack wakeup node del
---
src/lstack/api/lstack_epoll.c | 4 ++--
src/lstack/core/lstack_lwip.c | 2 +-
src/lstack/core/lstack_protocol_stack.c | 6 ++++++
src/lstack/core/lstack_stack_stat.c | 1 +
4 files changed, 10 insertions(+), 3 deletions(-)
diff --git a/src/lstack/api/lstack_epoll.c b/src/lstack/api/lstack_epoll.c
index 6ac245c..dcd58e7 100644
--- a/src/lstack/api/lstack_epoll.c
+++ b/src/lstack/api/lstack_epoll.c
@@ -164,8 +164,8 @@ int32_t lstack_epoll_close(int32_t fd)
}
if (sock->wakeup) {
- if (sock->stack) {
- unregister_wakeup(sock->stack, sock->wakeup);
+ if (sock->wakeup->bind_stack) {
+ unregister_wakeup(sock->wakeup->bind_stack, sock->wakeup);
}
posix_api->close_fn(sock->wakeup->eventfd);
pthread_spin_destroy(&sock->wakeup->event_list_lock);
diff --git a/src/lstack/core/lstack_lwip.c b/src/lstack/core/lstack_lwip.c
index 8c1df26..4fbaed1 100644
--- a/src/lstack/core/lstack_lwip.c
+++ b/src/lstack/core/lstack_lwip.c
@@ -486,7 +486,7 @@ static int32_t check_msg_vaild(const struct msghdr *message)
}
for (int32_t i = 0; i < message->msg_iovlen; i++) {
- if ((message->msg_iov[i].iov_base == NULL) || ((ssize_t)message->msg_iov[i].iov_len <= 0) ||
+ if ((message->msg_iov[i].iov_base == NULL) || ((ssize_t)message->msg_iov[i].iov_len < 0) ||
((size_t)(ssize_t)message->msg_iov[i].iov_len != message->msg_iov[i].iov_len) ||
((ssize_t)(buflen + (ssize_t)message->msg_iov[i].iov_len) <= 0)) {
GAZELLE_RETURN(EINVAL);
diff --git a/src/lstack/core/lstack_protocol_stack.c b/src/lstack/core/lstack_protocol_stack.c
index fbeca62..8283a41 100644
--- a/src/lstack/core/lstack_protocol_stack.c
+++ b/src/lstack/core/lstack_protocol_stack.c
@@ -355,6 +355,10 @@ static struct protocol_stack *stack_thread_init(uint16_t queue_id)
static void wakeup_stack_wait(struct protocol_stack *stack)
{
+ if (pthread_spin_trylock(&stack->wakeup_list_lock)) {
+ return;
+ }
+
struct wakeup_poll *node = stack->wakeup_list;
while (node) {
if (node->have_event) {
@@ -363,6 +367,8 @@ static void wakeup_stack_wait(struct protocol_stack *stack)
}
node = node->next;
}
+
+ pthread_spin_unlock(&stack->wakeup_list_lock);
}
static void* gazelle_stack_thread(void *arg)
diff --git a/src/lstack/core/lstack_stack_stat.c b/src/lstack/core/lstack_stack_stat.c
index b32f082..c011aed 100644
--- a/src/lstack/core/lstack_stack_stat.c
+++ b/src/lstack/core/lstack_stack_stat.c
@@ -124,6 +124,7 @@ void unregister_wakeup(struct protocol_stack *stack, struct wakeup_poll *wakeup)
} else {
stack->wakeup_list = node->next;
}
+ node->next = NULL;
pthread_spin_unlock(&stack->wakeup_list_lock);
}
--
2.23.0
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。