summaryrefslogtreecommitdiffstats
path: root/src/shutdown/shutdown.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/shutdown/shutdown.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/shutdown/shutdown.c b/src/shutdown/shutdown.c
index 97a4050ae9..ed873c61f1 100644
--- a/src/shutdown/shutdown.c
+++ b/src/shutdown/shutdown.c
@@ -168,12 +168,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. As the new root will be /run/initramfs/, it is not necessary to mount /run/
- * recursively. */
+ * recursively. Also, do not umount filesystems before MS_MOVE, as that should be done by ourself. */
return switch_root(
/* new_root= */ "/run/initramfs",
/* old_root_after= */ "/oldroot",
/* flags= */ SWITCH_ROOT_DONT_SYNC |
- SWITCH_ROOT_SKIP_RECURSIVE_RUN);
+ SWITCH_ROOT_SKIP_RECURSIVE_RUN |
+ SWITCH_ROOT_SKIP_RECURSIVE_UMOUNT);
}
/* Read the following fields from /proc/meminfo: