1 Star 0 Fork 50

庞庆/systemd_1

forked from src-anolis-os/systemd 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
0562-udev-run-link_update-with-increased-retry-count-in-s.patch 1.85 KB
一键复制 编辑 原始数据 按行查看 历史
geliwei 提交于 2021-06-16 16:46 . update to systemd-239-45.el8.src.rpm
From 1f3165bda13c8572c8c31d23c998835c4e2ad8f3 Mon Sep 17 00:00:00 2001
From: Michal Sekletar <msekleta@redhat.com>
Date: Thu, 4 Mar 2021 17:35:22 +0100
Subject: [PATCH] udev: run link_update() with increased retry count in second
invocation
In PR #17431 we have introduced retry loop in link_update() in order to
maximize the chance that we end up with correct target when there are
multiple contenders for given symlink.
Number of iterations in retry loop is either 1 or
LINK_UPDATE_MAX_RETRIES, depending on the value of 'initialized' db
flag. When device appears for the first time we need to set the
flag before calling link_update() via update_devnode() for the second
time to make sure we run the second invocation with higher retry loop
counter.
(cherry picked from commit 996c83903da5bf8b371314b4207ff97afeef65a4)
Related: #1931947
---
src/udev/udev-event.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/src/udev/udev-event.c b/src/udev/udev-event.c
index 9004634f65..eaec05523b 100644
--- a/src/udev/udev-event.c
+++ b/src/udev/udev-event.c
@@ -934,14 +934,13 @@ void udev_event_execute_rules(struct udev_event *event,
/* (re)write database file */
udev_device_tag_index(dev, event->dev_db, true);
udev_device_update_db(dev);
+ udev_device_set_is_initialized(dev);
/* Yes, we run update_devnode() twice, because in the first invocation, that is before update of udev database,
* it could happen that two contenders are replacing each other's symlink. Hence we run it again to make sure
* symlinks point to devices that claim them with the highest priority. */
update_devnode(event);
- udev_device_set_is_initialized(dev);
-
event->dev_db = udev_device_unref(event->dev_db);
}
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/pang-qing/systemd_1.git
git@gitee.com:pang-qing/systemd_1.git
pang-qing
systemd_1
systemd_1
a8

搜索帮助