* [PATCH] switch_root.c: umount mount points we cannot move with MNT_DETACH
@ 2011-11-14 13:11 harald
2011-11-14 13:51 ` Karel Zak
0 siblings, 1 reply; 2+ messages in thread
From: harald @ 2011-11-14 13:11 UTC (permalink / raw)
To: util-linux; +Cc: Harald Hoyer
From: Harald Hoyer <harald@redhat.com>
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
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] switch_root.c: umount mount points we cannot move with MNT_DETACH
2011-11-14 13:11 [PATCH] switch_root.c: umount mount points we cannot move with MNT_DETACH harald
@ 2011-11-14 13:51 ` Karel Zak
0 siblings, 0 replies; 2+ messages in thread
From: Karel Zak @ 2011-11-14 13:51 UTC (permalink / raw)
To: harald; +Cc: util-linux
On Mon, Nov 14, 2011 at 02:11:01PM +0100, harald@redhat.com wrote:
> sys-utils/switch_root.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
Applied, thanks.
--
Karel Zak <kzak@redhat.com>
http://karelzak.blogspot.com
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2011-11-14 13:51 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-11-14 13:11 [PATCH] switch_root.c: umount mount points we cannot move with MNT_DETACH harald
2011-11-14 13:51 ` Karel Zak
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).