代码拉取完成,页面将自动刷新
同步操作将从 yangshicheng/systemd 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
From e485f8a182f8a141676f7ffe0311a1a4724c3c1a Mon Sep 17 00:00:00 2001
From: licunlong <licunlong1@huawei.com>
Date: Tue, 28 Jun 2022 21:56:26 +0800
Subject: [PATCH] fix mount failed while daemon-reexec
---
src/core/manager.c | 1 +
src/core/manager.h | 1 +
src/core/mount.c | 5 ++++-
3 files changed, 6 insertions(+), 1 deletion(-)
diff --git a/src/core/manager.c b/src/core/manager.c
index 55adcd1..74f8304 100644
--- a/src/core/manager.c
+++ b/src/core/manager.c
@@ -1808,6 +1808,7 @@ int manager_startup(Manager *m, FILE *serialization, FDSet *fds) {
}
manager_ready(m);
+ m->mountinfo_uptodate = false;
manager_set_switching_root(m, false);
diff --git a/src/core/manager.h b/src/core/manager.h
index 31b4670..df74200 100644
--- a/src/core/manager.h
+++ b/src/core/manager.h
@@ -259,6 +259,7 @@ struct Manager {
/* Data specific to the mount subsystem */
struct libmnt_monitor *mount_monitor;
sd_event_source *mount_event_source;
+ bool mountinfo_uptodate;
/* Data specific to the swap filesystem */
FILE *proc_swaps;
diff --git a/src/core/mount.c b/src/core/mount.c
index 8fed04c..00482e9 100644
--- a/src/core/mount.c
+++ b/src/core/mount.c
@@ -1785,6 +1785,7 @@ static int mount_load_proc_self_mountinfo(Manager *m, bool set_flags) {
(void) mount_setup_unit(m, device, path, options, fstype, set_flags);
}
+ m->mountinfo_uptodate = true;
return 0;
}
@@ -1948,8 +1949,10 @@ static int mount_process_proc_self_mountinfo(Manager *m) {
assert(m);
r = drain_libmount(m);
- if (r <= 0)
+ if (r < 0)
return r;
+ if (r == 0 && m->mountinfo_uptodate)
+ return 0;
r = mount_load_proc_self_mountinfo(m, true);
if (r < 0) {
--
2.33.0
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。