1 Star 0 Fork 51

庞庆/systemd_1

forked from src-anolis-os/systemd 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
0686-mount-do-not-update-exec-deps-on-mountinfo-changes.patch 2.34 KB
一键复制 编辑 原始数据 按行查看 历史
qhw 提交于 2022-03-16 10:20 +08:00 . update to systemd-239-51.el8_5.5
From 9807f473b1b3e2aaf86bcbc6e6b9ad1328548b22 Mon Sep 17 00:00:00 2001
From: Lennart Poettering <lennart@poettering.net>
Date: Fri, 15 Nov 2019 14:00:54 +0100
Subject: [PATCH] mount: do not update exec deps on mountinfo changes
Fixes: #13978
(cherry picked from commit bf7eedbf8f8c83d9e775c80275f98f506ec963c6)
Related: #2038878
---
src/core/mount.c | 42 ++++++++++++++++++++++++++++--------------
1 file changed, 28 insertions(+), 14 deletions(-)
diff --git a/src/core/mount.c b/src/core/mount.c
index 4e0a4f238a..73c0531158 100644
--- a/src/core/mount.c
+++ b/src/core/mount.c
@@ -535,6 +535,32 @@ static int mount_verify(Mount *m) {
return 0;
}
+static int mount_add_non_exec_dependencies(Mount *m) {
+ int r;
+ assert(m);
+
+ /* Adds in all dependencies directly responsible for ordering the mount, as opposed to dependencies
+ * resulting from the ExecContext and such. */
+
+ r = mount_add_device_dependencies(m);
+ if (r < 0)
+ return r;
+
+ r = mount_add_mount_dependencies(m);
+ if (r < 0)
+ return r;
+
+ r = mount_add_quota_dependencies(m);
+ if (r < 0)
+ return r;
+
+ r = mount_add_default_dependencies(m);
+ if (r < 0)
+ return r;
+
+ return 0;
+}
+
static int mount_add_extras(Mount *m) {
Unit *u = UNIT(m);
int r;
@@ -558,18 +584,6 @@ static int mount_add_extras(Mount *m) {
return r;
}
- r = mount_add_device_dependencies(m);
- if (r < 0)
- return r;
-
- r = mount_add_mount_dependencies(m);
- if (r < 0)
- return r;
-
- r = mount_add_quota_dependencies(m);
- if (r < 0)
- return r;
-
r = unit_patch_contexts(u);
if (r < 0)
return r;
@@ -582,7 +596,7 @@ static int mount_add_extras(Mount *m) {
if (r < 0)
return r;
- r = mount_add_default_dependencies(m);
+ r = mount_add_non_exec_dependencies(m);
if (r < 0)
return r;
@@ -1526,7 +1540,7 @@ static int mount_setup_existing_unit(
}
if (load_extras)
- return mount_add_extras(MOUNT(u));
+ return mount_add_non_exec_dependencies(MOUNT(u));
return 0;
}
Loading...
马建仓 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

搜索帮助