代码拉取完成,页面将自动刷新
同步操作将从 src-openEuler/dim 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
From 3c3197390d14cc94e3e0117969ab8c70d0976dd0 Mon Sep 17 00:00:00 2001
From: jinlun <jinlun@huawei.com>
Date: Mon, 17 Jun 2024 20:28:35 +0800
Subject: [PATCH 07/14] fix resource clear in concurrent scenarios
---
src/common/dim_entry.c | 13 ++++++++++++-
src/core/dim_core_main.c | 2 +-
2 files changed, 13 insertions(+), 2 deletions(-)
diff --git a/src/common/dim_entry.c b/src/common/dim_entry.c
index a8dcae7..f2454ce 100644
--- a/src/common/dim_entry.c
+++ b/src/common/dim_entry.c
@@ -4,9 +4,12 @@
#include <linux/err.h>
#include <linux/security.h>
+#include <linux/delay.h>
#include "dim_entry.h"
+#define WAIT_TIME_MAX 1000
+
int dim_entry_create(struct dim_entry *entry, struct dentry *parent)
{
int ret = 0;
@@ -27,7 +30,15 @@ int dim_entry_create(struct dim_entry *entry, struct dentry *parent)
void dim_entry_remove(struct dim_entry *entry)
{
+ int time_ms = 0;
+
if (entry != NULL && entry->dentry != NULL) {
+ while (d_is_dir(entry->dentry) &&
+ !simple_empty(entry->dentry) &&
+ time_ms < WAIT_TIME_MAX) {
+ time_ms++;
+ msleep(1);
+ }
securityfs_remove(entry->dentry);
entry->dentry = NULL;
}
@@ -60,4 +71,4 @@ void dim_entry_remove_list(struct dim_entry **list, unsigned int len)
for (i = 0; i < len; i++)
dim_entry_remove(list[i]);
-}
\ No newline at end of file
+}
diff --git a/src/core/dim_core_main.c b/src/core/dim_core_main.c
index de18d66..d4cc870 100644
--- a/src/core/dim_core_main.c
+++ b/src/core/dim_core_main.c
@@ -91,8 +91,8 @@ err:
static void __exit dim_core_exit(void)
{
- dim_core_measure_destroy();
dim_core_destroy_fs();
+ dim_core_measure_destroy();
dim_mem_pool_destroy();
if (signature)
--
2.33.0
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。