mirror of https://github.com/mkerrisk/man-pages
umount.2: Move "shared mount + umount" text to a subsection in MOTTES
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
This commit is contained in:
parent
50a4b0aafc
commit
430a1677d2
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue