From 430a1677d2e0917f316fdeefea46a0ad9e25210a Mon Sep 17 00:00:00 2001 From: Michael Kerrisk Date: Mon, 2 Feb 2015 13:02:02 +0100 Subject: [PATCH] umount.2: Move "shared mount + umount" text to a subsection in MOTTES Signed-off-by: Michael Kerrisk --- man2/umount.2 | 66 +++++++++++++++++++++++++-------------------------- 1 file changed, 33 insertions(+), 33 deletions(-) diff --git a/man2/umount.2 b/man2/umount.2 index 5b3f1467b..e21be350e 100644 --- a/man2/umount.2 +++ b/man2/umount.2 @@ -97,39 +97,6 @@ Don't dereference if it is a symbolic link. This flag allows security problems to be avoided in set-user-ID-\fIroot\fP programs that allow unprivileged users to unmount filesystems. -.PP -Shared mount points cause any mount activity on a mount point, including -.BR umount (2) -operations, to be forwarded to every shared mount point in the -peer group and every slave mount of that peer group. -This means that -.BR umount (2) -of any peer in a set of shared mounts will cause all of its -peers to be unmounted and all of their slaves to be unmounted as well. - -This propagation of unmount activity can be particularly surprising -on systems where every mount point is shared by default. -On such systems, -recursively bind mounting the root directory of the filesystem -onto a subdirectory and then later unmounting that subdirectory with -.BR MNT_DETACH -will cause every mount in the mount namespace to be lazily unmounted. - -To ensure -.BR umount (2) -does not propagate in this fashion, -the mount point may be remounted using a -.BR mount (2) -call with a -.I mount_flags -argument that includes both -.BR MS_REC -and -.BR MS_PRIVATE -prior to -.BR umount (2) -being called. - .SH RETURN VALUE On success, zero is returned. On error, \-1 is returned, and @@ -197,6 +164,39 @@ are available in glibc since version 2.11. These functions are Linux-specific and should not be used in programs intended to be portable. .SH NOTES +.SS umount() amd shared mount points +Shared mount points cause any mount activity on a mount point, including +.BR umount (2) +operations, to be forwarded to every shared mount point in the +peer group and every slave mount of that peer group. +This means that +.BR umount (2) +of any peer in a set of shared mounts will cause all of its +peers to be unmounted and all of their slaves to be unmounted as well. + +This propagation of unmount activity can be particularly surprising +on systems where every mount point is shared by default. +On such systems, +recursively bind mounting the root directory of the filesystem +onto a subdirectory and then later unmounting that subdirectory with +.BR MNT_DETACH +will cause every mount in the mount namespace to be lazily unmounted. + +To ensure +.BR umount (2) +does not propagate in this fashion, +the mount point may be remounted using a +.BR mount (2) +call with a +.I mount_flags +argument that includes both +.BR MS_REC +and +.BR MS_PRIVATE +prior to +.BR umount (2) +being called. +.SS Historical details The original .BR umount () function was called as \fIumount(device)\fP and would return