summaryrefslogtreecommitdiffstats
path: root/src/shutdown/shutdown.c
diff options
context:
space:
mode:
authorYu Watanabe <watanabe.yu+github@gmail.com>2023-08-02 19:50:09 +0200
committerYu Watanabe <watanabe.yu+github@gmail.com>2023-08-03 20:57:32 +0200
commitd709d1b20e2e15ee2ae1b44de94d493e17834235 (patch)
treef7db364c637f9e0b6d99669c5949a9e414ee3e99 /src/shutdown/shutdown.c
parentpo: Translated using Weblate (Turkish) (diff)
downloadsystemd-d709d1b20e2e15ee2ae1b44de94d493e17834235.tar.xz
systemd-d709d1b20e2e15ee2ae1b44de94d493e17834235.zip
shutdown: disable recursive mount of /run/ on switching root
Mounting /run/ recursively may be harmless, but not necessary on shutdown as the new root is /run/initramfs. Follow-up for b12d41a8bb7c99f7d7a1c7821a886d98b42d9ce0.
Diffstat (limited to '')
-rw-r--r--src/shutdown/shutdown.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/shutdown/shutdown.c b/src/shutdown/shutdown.c
index 8395bb429d..97a4050ae9 100644
--- a/src/shutdown/shutdown.c
+++ b/src/shutdown/shutdown.c
@@ -167,11 +167,13 @@ static int switch_root_initramfs(void) {
*
* Disable sync() during switch-root, we after all sync'ed here plenty, and a dumb sync (as opposed
* to the "smart" sync() we did here that looks at progress parameters) would defeat much of our
- * efforts here. */
+ * efforts here. As the new root will be /run/initramfs/, it is not necessary to mount /run/
+ * recursively. */
return switch_root(
/* new_root= */ "/run/initramfs",
/* old_root_after= */ "/oldroot",
- /* flags= */ SWITCH_ROOT_DONT_SYNC);
+ /* flags= */ SWITCH_ROOT_DONT_SYNC |
+ SWITCH_ROOT_SKIP_RECURSIVE_RUN);
}
/* Read the following fields from /proc/meminfo: