[PATCH] switch_root.c: umount mount points we cannot move with MNT_DETACH

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Harald Hoyer <harald@xxxxxxxxxx>

If a mount point cannot be moved to the new root, umount it with
MNT_DETACH, so that it is lazy umounted and does not show up in
/proc/mounts anymore.
---
 sys-utils/switch_root.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/sys-utils/switch_root.c b/sys-utils/switch_root.c
index e50f310..a49a1f7 100644
--- a/sys-utils/switch_root.c
+++ b/sys-utils/switch_root.c
@@ -131,7 +131,7 @@ static int switchroot(const char *newroot)
 
 		if ((stat(newmount, &sb) != 0) || (sb.st_dev != newroot_stat.st_dev)) {
 			/* mount point seems to be mounted already or stat failed */
-			umount(umounts[i]);
+			umount2(umounts[i], MNT_DETACH);
 			continue;
 		}
 
-- 
1.7.7

--
To unsubscribe from this list: send the line "unsubscribe util-linux" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux