代码拉取完成,页面将自动刷新
同步操作将从 src-openEuler/systemd 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
From f2a5412bf286cabc047dc96395c2dae978e722b4 Mon Sep 17 00:00:00 2001
From: Yu Watanabe <watanabe.yu+github@gmail.com>
Date: Thu, 17 Jun 2021 15:47:34 +0900
Subject: [PATCH] udev: propagate error on spawning a worker
Reference:https://github.com/systemd/systemd/commit/f2a5412bf286cabc047dc96395c2dae978e722b4
Conflict:NA
---
src/udev/udevd.c | 23 +++++++++++++++--------
1 file changed, 15 insertions(+), 8 deletions(-)
diff --git a/src/udev/udevd.c b/src/udev/udevd.c
index 2179825..7f41336 100644
--- a/src/udev/udevd.c
+++ b/src/udev/udevd.c
@@ -720,16 +720,18 @@ static int worker_spawn(Manager *manager, Event *event) {
return 0;
}
-static void event_run(Manager *manager, Event *event) {
+static int event_run(Event *event) {
static bool log_children_max_reached = true;
+ Manager *manager;
Worker *worker;
int r;
- assert(manager);
assert(event);
+ assert(event->manager);
log_device_uevent(event->dev, "Device ready for processing");
+ manager = event->manager;
HASHMAP_FOREACH(worker, manager->workers) {
if (worker->state != WORKER_IDLE)
continue;
@@ -743,29 +745,32 @@ static void event_run(Manager *manager, Event *event) {
continue;
}
worker_attach_event(worker, event);
- return;
+ return 1; /* event is now processing. */
}
if (hashmap_size(manager->workers) >= arg_children_max) {
-
/* Avoid spamming the debug logs if the limit is already reached and
* many events still need to be processed */
if (log_children_max_reached && arg_children_max > 1) {
log_debug("Maximum number (%u) of children reached.", hashmap_size(manager->workers));
log_children_max_reached = false;
}
- return;
+ return 0; /* no free worker */
}
/* Re-enable the debug message for the next batch of events */
log_children_max_reached = true;
/* fork with up-to-date SELinux label database, so the child inherits the up-to-date db
- and, until the next SELinux policy changes, we safe further reloads in future children */
+ * and, until the next SELinux policy changes, we safe further reloads in future children */
mac_selinux_maybe_reload();
/* start new worker and pass initial device */
- worker_spawn(manager, event);
+ r = worker_spawn(manager, event);
+ if (r < 0)
+ return r;
+
+ return 1; /* event is now processing. */
}
/* lookup event for identical, parent, child device */
@@ -921,7 +926,9 @@ static int event_queue_start(Manager *manager) {
if (is_device_busy(manager, event) != 0)
continue;
- event_run(manager, event);
+ r = event_run(event);
+ if (r < 0)
+ return r;
}
return 0;
--
2.33.0
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。