summaryrefslogtreecommitdiff
path: root/core/systemd/0001-shutdown-recursively-mark-root-as-private-before-piv.patch
blob: 5c6085c95e898fc5e591f065f7151aa31444703b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
From 4bfa638d43c05e8db052cd55818765bb3575a405 Mon Sep 17 00:00:00 2001
From: Dave Reisner <dreisner@archlinux.org>
Date: Fri, 10 Aug 2012 11:02:03 -0400
Subject: [PATCH] shutdown: recursively mark root as private before pivot

Because root is now recursively marked as shared on bootup, we need to
recursively mark root as private. This prevents a pivot_root failure on
shutdown:

  Cannot finalize remaining file systems and devices, giving up.
  pivot failed: Invalid argument
---
 src/core/shutdown.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/core/shutdown.c b/src/core/shutdown.c
index 105a604..0b7cbd8 100644
--- a/src/core/shutdown.c
+++ b/src/core/shutdown.c
@@ -109,7 +109,7 @@ static int pivot_to_new_root(void) {
           It works for pivot_root, but the ref count for the root device
           is not decreasing :-/
         */
-        if (mount(NULL, "/", NULL, MS_PRIVATE, NULL) < 0) {
+        if (mount(NULL, "/", NULL, MS_REC|MS_PRIVATE, NULL) < 0) {
                 log_error("Failed to make \"/\" private mount %m");
                 return -errno;
         }
-- 
1.7.11.4