Fetch the repository succeeded.
This action will force synchronization from yangshicheng/systemd, which will overwrite any changes that you have made since you forked the repository, and can not be recovered!!!
Synchronous operation will process in the background and will refresh the page when finishing processing. Please be patient.
From c9473aaa5b69c47edab365b46abee6e9ab5b18dc Mon Sep 17 00:00:00 2001
From: Yu Watanabe <watanabe.yu+github@gmail.com>
Date: Fri, 25 Mar 2022 01:13:39 +0900
Subject: [PATCH] udev: drop unnecessary clone of received sd-device object
As the sd-device object received through sd-device-monitor is sealed,
so the corresponding udev database or uevent file will not be read.
Reference:https://github.com/systemd/systemd/commit/c9473aaa5b69c47edab365b46abee6e9ab5b18dc
Conflict:adaption
---
src/udev/udevd.c | 21 ++++-----------------
1 file changed, 4 insertions(+), 17 deletions(-)
diff --git a/src/udev/udevd.c b/src/udev/udevd.c
index 108142e9c619..05397df7a429 100644
--- a/src/udev/udevd.c
+++ b/src/udev/udevd.c
@@ -124,7 +124,6 @@ typedef struct Event {
EventState state;
sd_device *dev;
- sd_device *dev_kernel; /* clone of originally received device */
uint64_t seqnum;
uint64_t blocker_seqnum;
@@ -163,7 +162,6 @@ static Event *event_free(Event *event) {
LIST_REMOVE(event, event->manager->events, event);
sd_device_unref(event->dev);
- sd_device_unref(event->dev_kernel);
sd_event_source_unref(event->timeout_warning_event);
sd_event_source_unref(event->timeout_event);
@@ -973,9 +971,8 @@ static int event_queue_start(Manager *manager) {
}
static int event_queue_insert(Manager *manager, sd_device *dev) {
- _cleanup_(sd_device_unrefp) sd_device *clone = NULL;
- Event *event;
uint64_t seqnum;
+ Event *event;
int r;
assert(manager);
@@ -989,15 +986,6 @@ static int event_queue_insert(Manager *manager, sd_device *dev) {
if (r < 0)
return r;
- /* Save original device to restore the state on failures. */
- r = device_shallow_clone(dev, &clone);
- if (r < 0)
- return r;
-
- r = device_copy_properties(clone, dev);
- if (r < 0)
- return r;
-
event = new(Event, 1);
if (!event)
return -ENOMEM;
@@ -1005,7 +993,6 @@ static int event_queue_insert(Manager *manager, sd_device *dev) {
*event = (Event) {
.manager = manager,
.dev = sd_device_ref(dev),
- .dev_kernel = TAKE_PTR(clone),
.seqnum = seqnum,
.state = EVENT_QUEUED,
};
@@ -1440,10 +1427,10 @@ static int on_sigchld(sd_event_source *s, const struct signalfd_siginfo *si, voi
device_tag_index(worker->event->dev, NULL, false);
if (manager->monitor) {
- /* Forward kernel event unchanged */
- r = device_monitor_send_device(manager->monitor, NULL, worker->event->dev_kernel);
+ /* Forward kernel event to libudev listeners */
+ r = device_monitor_send_device(manager->monitor, NULL, worker->event->dev);
if (r < 0)
- log_device_warning_errno(worker->event->dev_kernel, r,
+ log_device_warning_errno(worker->event->dev, r,
"Failed to broadcast failed event to libudev listeners, ignoring: %m");
}
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。