Compare commits

...

10 Commits

Author SHA1 Message Date
Michael Kerrisk 18ce9c4a1b accept.2, access.2, getpriority.2, mlock.2: ERRORS: combine errors into a single list
These split out errors into separate lists (perhaps per API,
perhaps "may" vs "shall", perhaps "Linux-specific" vs
standard(??)), but there's no good reason to do this.  It makes
the error list harder to read, and is inconsistent with other
pages. So, combine the errors into a single list.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-08-18 01:38:14 +02:00
Michael Kerrisk cfda555640 getpass.3: wfix
Remove redundant phrase.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-08-18 01:38:14 +02:00
Michael Kerrisk 65f96dae10 shmop.2: wfix
Reported-by: Helge Kreutzmann <debian@helgefjell.de>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-08-18 01:38:14 +02:00
Michael Kerrisk dd0ccf19b2 proc.5: Remove duplicated /proc/[pid]/gid_map entry
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-08-18 01:38:14 +02:00
Michael Kerrisk 8273bf01f9 proc.5: Add /proc/PID/projid_map, referring reader to user_namespaces(7)
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-08-18 01:38:14 +02:00
Michael Kerrisk 9ae13fffd2 user_namespaces.7: tfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-08-18 01:38:14 +02:00
Michael Kerrisk 213e259e97 user_namespaces.7: Document /proc/PID/projid_map
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-08-18 01:38:14 +02:00
Michael Kerrisk 6486faa956 user_namespaces.7: Minor wording improvement
Mainly in preparation for the following patch on project IDs maps.
Add some words that will make the parallels between the rules for
updating uid_map and projid_map clearer.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-08-18 01:38:14 +02:00
Michael Kerrisk 525a8b5461 fanotify_mark.2, link.2, mount.2, umount.2, proc.5, cgroups.7, fanotify.7: Terminology clean-up: "mount point" ==> "mount"
Many times, these pages use the terminology "mount point", where
"mount" would be better. A "mount point" is the location at which
a mount is attached. A "mount" is an association between a
filesystem and a mount point.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-08-18 01:38:14 +02:00
Michael Kerrisk 7ccfe34995 rename.2: wfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-08-18 01:38:14 +02:00
15 changed files with 241 additions and 206 deletions

View File

@ -261,15 +261,11 @@ does not refer to a socket.
The referenced socket is not of type The referenced socket is not of type
.BR SOCK_STREAM . .BR SOCK_STREAM .
.TP .TP
.B EPROTO
Protocol error.
.PP
In addition, Linux
.BR accept ()
may fail if:
.TP
.B EPERM .B EPERM
Firewall rules forbid connection. Firewall rules forbid connection.
.TP
.B EPROTO
Protocol error.
.PP .PP
In addition, network errors for the new socket and as defined In addition, network errors for the new socket and as defined
for the protocol may be returned. for the protocol may be returned.

View File

@ -218,10 +218,6 @@ and the file does not exist, or some other error occurred),
.I errno .I errno
is set to indicate the error. is set to indicate the error.
.SH ERRORS .SH ERRORS
.BR access ()
and
.BR faccessat ()
shall fail if:
.TP .TP
.B EACCES .B EACCES
The requested access would be denied to the file, or search permission The requested access would be denied to the file, or search permission
@ -230,6 +226,32 @@ is denied for one of the directories in the path prefix of
(See also (See also
.BR path_resolution (7).) .BR path_resolution (7).)
.TP .TP
.B EBADF
.RB ( faccessat ())
.I pathname
is relative but
.I dirfd
is neither
.B AT_FDCWD
.RB ( faccessat ())
nor a valid file descriptor.
.TP
.B EFAULT
.I pathname
points outside your accessible address space.
.TP
.B EINVAL
.I mode
was incorrectly specified.
.TP
.B EINVAL
.RB ( faccessat ())
Invalid flag specified in
.IR flags .
.TP
.B EIO
An I/O error occurred.
.TP
.B ELOOP .B ELOOP
Too many symbolic links were encountered in resolving Too many symbolic links were encountered in resolving
.IR pathname . .IR pathname .
@ -243,57 +265,27 @@ A component of
.I pathname .I pathname
does not exist or is a dangling symbolic link. does not exist or is a dangling symbolic link.
.TP .TP
.B ENOMEM
Insufficient kernel memory was available.
.TP
.B ENOTDIR .B ENOTDIR
A component used as a directory in A component used as a directory in
.I pathname .I pathname
is not, in fact, a directory. is not, in fact, a directory.
.TP .TP
.B EROFS
Write permission was requested for a file on a read-only filesystem.
.PP
.BR access ()
and
.BR faccessat ()
may fail if:
.TP
.B EFAULT
.I pathname
points outside your accessible address space.
.TP
.B EINVAL
.I mode
was incorrectly specified.
.TP
.B EIO
An I/O error occurred.
.TP
.B ENOMEM
Insufficient kernel memory was available.
.TP
.B ETXTBSY
Write access was requested to an executable which is being
executed.
.PP
The following additional errors can occur for
.BR faccessat ():
.TP
.B EBADF
.I pathname
is relative but
.I dirfd
is neither
.B AT_FDCWD
nor a valid file descriptor.
.TP
.B EINVAL
Invalid flag specified in
.IR flags .
.TP
.B ENOTDIR .B ENOTDIR
.RB ( faccessat ())
.I pathname .I pathname
is relative and is relative and
.I dirfd .I dirfd
is a file descriptor referring to a file other than a directory. is a file descriptor referring to a file other than a directory.
.TP
.B EROFS
Write permission was requested for a file on a read-only filesystem.
.TP
.B ETXTBSY
Write access was requested to an executable which is being
executed.
.SH VERSIONS .SH VERSIONS
.BR faccessat () .BR faccessat ()
was added to Linux in kernel 2.6.16; was added to Linux in kernel 2.6.16;

View File

@ -117,14 +117,14 @@ If the filesystem object to be marked is not a directory, the error
shall be raised. shall be raised.
.TP .TP
.B FAN_MARK_MOUNT .B FAN_MARK_MOUNT
Mark the mount point specified by Mark the mount specified by
.IR pathname . .IR pathname .
If If
.I pathname .I pathname
is not itself a mount point, the mount point containing is not itself a mount point, the mount containing
.I pathname .I pathname
will be marked. will be marked.
All directories, subdirectories, and the contained files of the mount point All directories, subdirectories, and the contained files of the mount
will be monitored. will be monitored.
The events which require that filesystem objects are identified by file handles, The events which require that filesystem objects are identified by file handles,
such as such as

View File

@ -142,6 +142,13 @@ On failure, it returns \-1 and sets
to indicate the error. to indicate the error.
.SH ERRORS .SH ERRORS
.TP .TP
.B EACCES
The caller attempted to set a lower nice value
(i.e., a higher process priority), but did not
have the required privilege (on Linux: did not have the
.B CAP_SYS_NICE
capability).
.TP
.B EINVAL .B EINVAL
.I which .I which
was not one of was not one of
@ -150,24 +157,6 @@ was not one of
or or
.BR PRIO_USER . .BR PRIO_USER .
.TP .TP
.B ESRCH
No process was located using the
.I which
and
.I who
values specified.
.PP
In addition to the errors indicated above,
.BR setpriority ()
may fail if:
.TP
.B EACCES
The caller attempted to set a lower nice value
(i.e., a higher process priority), but did not
have the required privilege (on Linux: did not have the
.B CAP_SYS_NICE
capability).
.TP
.B EPERM .B EPERM
A process was located, but its effective user ID did not match A process was located, but its effective user ID did not match
either the effective or the real user ID of the caller, either the effective or the real user ID of the caller,
@ -175,6 +164,13 @@ and was not privileged (on Linux: did not have the
.B CAP_SYS_NICE .B CAP_SYS_NICE
capability). capability).
But see NOTES below. But see NOTES below.
.TP
.B ESRCH
No process was located using the
.I which
and
.I who
values specified.
.SH CONFORMING TO .SH CONFORMING TO
POSIX.1-2001, POSIX.1-2008, POSIX.1-2001, POSIX.1-2008,
SVr4, 4.4BSD (these interfaces first appeared in 4.2BSD). SVr4, 4.4BSD (these interfaces first appeared in 4.2BSD).

View File

@ -275,7 +275,7 @@ The file is on a read-only filesystem.
are not on the same mounted filesystem. are not on the same mounted filesystem.
(Linux permits a filesystem to be mounted at multiple points, but (Linux permits a filesystem to be mounted at multiple points, but
.BR link () .BR link ()
does not work across different mount points, does not work across different mounts,
even if the same filesystem is mounted on both.) even if the same filesystem is mounted on both.)
.PP .PP
The following additional errors can occur for The following additional errors can occur for

View File

@ -182,6 +182,64 @@ is set to indicate the error,
and no changes are made to any locks in the and no changes are made to any locks in the
address space of the process. address space of the process.
.SH ERRORS .SH ERRORS
.\"SVr4 documents an additional EAGAIN error code.
.TP
.B EAGAIN
.RB ( mlock (),
.BR mlock2 (),
and
.BR munlock ())
Some or all of the specified address range could not be locked.
.TP
.B EINVAL
.RB ( mlock (),
.BR mlock2 (),
and
.BR munlock ())
The result of the addition
.IR addr + len
was less than
.IR addr
(e.g., the addition may have resulted in an overflow).
.TP
.B EINVAL
.RB ( mlock2 ())
Unknown \fIflags\fP were specified.
.TP
.B EINVAL
.RB ( mlockall ())
Unknown \fIflags\fP were specified or
.B MCL_ONFAULT
was specified without either
.B MCL_FUTURE
or
.BR MCL_CURRENT .
.TP
.B EINVAL
(Not on Linux)
.I addr
was not a multiple of the page size.
.TP
.B ENOMEM
.RB ( mlock (),
.BR mlock2 (),
and
.BR munlock ())
Some of the specified address range does not correspond to mapped
pages in the address space of the process.
.TP
.B ENOMEM
.RB ( mlock (),
.BR mlock2 (),
and
.BR munlock ())
Locking or unlocking a region would result in the total number of
mappings with distinct attributes (e.g., locked versus unlocked)
exceeding the allowed maximum.
.\" I.e., the number of VMAs would exceed the 64kB maximum
(For example, unlocking a range in the middle of a currently locked
mapping would result in three mappings:
two locked mappings at each end and an unlocked mapping in the middle.)
.TP .TP
.B ENOMEM .B ENOMEM
(Linux 2.6.9 and later) the caller had a nonzero (Linux 2.6.9 and later) the caller had a nonzero
@ -207,63 +265,9 @@ half of RAM.
The caller is not privileged, but needs privilege The caller is not privileged, but needs privilege
.RB ( CAP_IPC_LOCK ) .RB ( CAP_IPC_LOCK )
to perform the requested operation. to perform the requested operation.
.\"SVr4 documents an additional EAGAIN error code.
.PP
For
.BR mlock (),
.BR mlock2 (),
and
.BR munlock ():
.TP
.B EAGAIN
Some or all of the specified address range could not be locked.
.TP
.B EINVAL
The result of the addition
.IR addr + len
was less than
.IR addr
(e.g., the addition may have resulted in an overflow).
.TP
.B EINVAL
(Not on Linux)
.I addr
was not a multiple of the page size.
.TP
.B ENOMEM
Some of the specified address range does not correspond to mapped
pages in the address space of the process.
.TP
.B ENOMEM
Locking or unlocking a region would result in the total number of
mappings with distinct attributes (e.g., locked versus unlocked)
exceeding the allowed maximum.
.\" I.e., the number of VMAs would exceed the 64kB maximum
(For example, unlocking a range in the middle of a currently locked
mapping would result in three mappings:
two locked mappings at each end and an unlocked mapping in the middle.)
.PP
For
.BR mlock2 ():
.TP
.B EINVAL
Unknown \fIflags\fP were specified.
.PP
For
.BR mlockall ():
.TP
.B EINVAL
Unknown \fIflags\fP were specified or
.B MCL_ONFAULT
was specified without either
.B MCL_FUTURE
or
.BR MCL_CURRENT .
.PP
For
.BR munlockall ():
.TP .TP
.B EPERM .B EPERM
.RB ( munlockall ())
(Linux 2.6.8 and earlier) The caller was not privileged (Linux 2.6.8 and earlier) The caller was not privileged
.RB ( CAP_IPC_LOCK ). .RB ( CAP_IPC_LOCK ).
.SH VERSIONS .SH VERSIONS

View File

@ -333,7 +333,7 @@ mount of the filesystem, and will be shared by all subsequent mounts
of the same filesystem. of the same filesystem.
Subsequently, the settings of the flags can be changed Subsequently, the settings of the flags can be changed
via a remount operation (see below). via a remount operation (see below).
Such changes will be visible via all mount points associated Such changes will be visible via all mounts associated
with the filesystem. with the filesystem.
.PP .PP
Since Linux 2.6.16, Since Linux 2.6.16,
@ -411,8 +411,8 @@ and
.BR MS_SILENT .BR MS_SILENT
flags during a remount are silently ignored. flags during a remount are silently ignored.
Note that changes to per-superblock flags are visible via Note that changes to per-superblock flags are visible via
all mount points of the associated filesystem all mounts of the associated filesystem
(because the per-superblock flags are shared by all mount points). (because the per-superblock flags are shared by all mounts).
.PP .PP
Since Linux 3.17, Since Linux 3.17,
.\" commit ffbc6f0ead47fa5a1dc9642b0331cb75c20a640e .\" commit ffbc6f0ead47fa5a1dc9642b0331cb75c20a640e
@ -435,7 +435,7 @@ flag can be used with
to modify only the per-mount-point flags. to modify only the per-mount-point flags.
.\" See https://lwn.net/Articles/281157/ .\" See https://lwn.net/Articles/281157/
This is particularly useful for setting or clearing the "read-only" This is particularly useful for setting or clearing the "read-only"
flag on a mount point without changing the underlying filesystem. flag on a mount without changing the underlying filesystem.
Specifying Specifying
.IR mountflags .IR mountflags
as: as:
@ -447,7 +447,7 @@ MS_REMOUNT | MS_BIND | MS_RDONLY
.in .in
.PP .PP
will make access through this mountpoint read-only, without affecting will make access through this mountpoint read-only, without affecting
other mount points. other mounts.
.\" .\"
.SS Creating a bind mount .SS Creating a bind mount
If If
@ -475,7 +475,7 @@ described below) in the
.I mountflags .I mountflags
argument are also ignored. argument are also ignored.
(The bind mount has the same mount options as (The bind mount has the same mount options as
the underlying mount point.) the underlying mount.)
However, see the discussion of remounting above, However, see the discussion of remounting above,
for a method of making an existing bind mount read-only. for a method of making an existing bind mount read-only.
.PP .PP
@ -523,31 +523,31 @@ arguments are ignored.
The meanings of the propagation type flags are as follows: The meanings of the propagation type flags are as follows:
.TP .TP
.BR MS_SHARED .BR MS_SHARED
Make this mount point shared. Make this mount shared.
Mount and unmount events immediately under this mount point will propagate Mount and unmount events immediately under this mount will propagate
to the other mount points that are members of this mount's peer group. to the other mounts that are members of this mount's peer group.
Propagation here means that the same mount or unmount will automatically Propagation here means that the same mount or unmount will automatically
occur under all of the other mount points in the peer group. occur under all of the other mounts in the peer group.
Conversely, mount and unmount events that take place under Conversely, mount and unmount events that take place under
peer mount points will propagate to this mount point. peer mounts will propagate to this mount.
.TP .TP
.BR MS_PRIVATE .BR MS_PRIVATE
Make this mount point private. Make this mount private.
Mount and unmount events do not propagate into or out of this mount point. Mount and unmount events do not propagate into or out of this mount.
.TP .TP
.BR MS_SLAVE .BR MS_SLAVE
If this is a shared mount point that is a member of a peer group If this is a shared mount that is a member of a peer group
that contains other members, convert it to a slave mount. that contains other members, convert it to a slave mount.
If this is a shared mount point that is a member of a peer group If this is a shared mount that is a member of a peer group
that contains no other members, convert it to a private mount. that contains no other members, convert it to a private mount.
Otherwise, the propagation type of the mount point is left unchanged. Otherwise, the propagation type of the mount is left unchanged.
.IP .IP
When a mount point is a slave, When a mount is a slave,
mount and unmount events propagate into this mount point from mount and unmount events propagate into this mount from
the (master) shared peer group of which it was formerly a member. the (master) shared peer group of which it was formerly a member.
Mount and unmount events under this mount point do not propagate to any peer. Mount and unmount events under this mount do not propagate to any peer.
.IP .IP
A mount point can be the slave of another peer group A mount can be the slave of another peer group
while at the same time sharing mount and unmount events while at the same time sharing mount and unmount events
with a peer group of which it is a member. with a peer group of which it is a member.
.TP .TP
@ -568,12 +568,12 @@ when replicating that subtree to produce the target subtree.
.PP .PP
By default, changing the propagation type affects only the By default, changing the propagation type affects only the
.I target .I target
mount point. mount.
If the If the
.B MS_REC .B MS_REC
flag is also specified in flag is also specified in
.IR mountflags , .IR mountflags ,
then the propagation type of all mount points under then the propagation type of all mounts under
.IR target .IR target
is also changed. is also changed.
.PP .PP
@ -589,9 +589,9 @@ contains the flag
(available since Linux 2.4.18), (available since Linux 2.4.18),
then move a subtree: then move a subtree:
.I source .I source
specifies an existing mount point and specifies an existing mount and
.I target .I target
specifies the new location to which that mount point is to be relocated. specifies the new location to which that mount is to be relocated.
The move is atomic: at no point is the subtree unmounted. The move is atomic: at no point is the subtree unmounted.
.PP .PP
The remaining bits in the The remaining bits in the
@ -602,7 +602,7 @@ and
.IR data .IR data
arguments. arguments.
.\" .\"
.SS Creating a new mount point .SS Creating a new mount
If none of If none of
.BR MS_REMOUNT , .BR MS_REMOUNT ,
.BR MS_BIND , .BR MS_BIND ,
@ -616,9 +616,9 @@ is specified in
.IR mountflags , .IR mountflags ,
then then
.BR mount () .BR mount ()
performs its default action: creating a new mount point. performs its default action: creating a new mount.
.IR source .IR source
specifies the source for the new mount point, and specifies the source for the new mount, and
.IR target .IR target
specifies the directory at which to create the mount point. specifies the directory at which to create the mount point.
.PP .PP
@ -709,7 +709,7 @@ was attempted, but the mount tree under
.I source .I source
includes unbindable mounts and includes unbindable mounts and
.I target .I target
is a mount point that has propagation type is a mount that has propagation type
.BR MS_SHARED . .BR MS_SHARED .
.TP .TP
.B EINVAL .B EINVAL
@ -725,7 +725,7 @@ A move operation
.RB ( MS_MOVE ) .RB ( MS_MOVE )
was attempted, but was attempted, but
.I source .I source
was not a mount point, or was \(aq/\(aq. was not a mount, or was \(aq/\(aq.
.TP .TP
.B EINVAL .B EINVAL
A bind operation A bind operation
@ -924,33 +924,33 @@ subsequently creates) and vice versa.
For further details on mount namespaces, see For further details on mount namespaces, see
.BR mount_namespaces (7). .BR mount_namespaces (7).
.\" .\"
.SS Parental relationship between mount points .SS Parental relationship between mounts
Each mount point has a parent mount point. Each mount has a parent mount.
The overall parental relationship of all mount points defines The overall parental relationship of all mounts defines
the single directory hierarchy seen by the processes within a mount namespace. the single directory hierarchy seen by the processes within a mount namespace.
.PP .PP
The parent of a new mount point is defined when the mount point is created. The parent of a new mount is defined when the mount is created.
In the usual case, In the usual case,
the parent of a new mount is the mount point of the filesystem the parent of a new mount is the mount of the filesystem
containing the directory or file at which the new mount is attached. containing the directory or file at which the new mount is attached.
In the case where a new mount is stacked on top of an existing mount, In the case where a new mount is stacked on top of an existing mount,
the parent of the new mount is the previous mount that was stacked the parent of the new mount is the previous mount that was stacked
at that location. at that location.
.PP .PP
The parental relationship between mount points can be discovered via the The parental relationship between mounts can be discovered via the
.I /proc/[pid]/mountinfo .I /proc/[pid]/mountinfo
file (see below). file (see below).
.\" .\"
.SS /proc/[pid]/mounts and /proc/[pid]/mountinfo .SS /proc/[pid]/mounts and /proc/[pid]/mountinfo
The Linux-specific The Linux-specific
.I /proc/[pid]/mounts .I /proc/[pid]/mounts
file exposes the list of mount points in the mount file exposes the list of mounts in the mount
namespace of the process with the specified ID. namespace of the process with the specified ID.
The The
.I /proc/[pid]/mountinfo .I /proc/[pid]/mountinfo
file exposes even more information about mount points, file exposes even more information about mounts,
including the propagation type and mount ID information that makes it including the propagation type and mount ID information that makes it
possible to discover the parental relationship between mount points. possible to discover the parental relationship between mounts.
See See
.BR proc (5) .BR proc (5)
and and

View File

@ -322,7 +322,7 @@ The rename fails because
is a directory that is in use by some process (perhaps as is a directory that is in use by some process (perhaps as
current working directory, or as root directory, or because current working directory, or as root directory, or because
it was open for reading) or is in use by the system it was open for reading) or is in use by the system
(for example as mount point), while the system considers (for example as a mount point), while the system considers
this an error. this an error.
(Note that there is no requirement to return (Note that there is no requirement to return
.B EBUSY .B EBUSY

View File

@ -324,10 +324,14 @@ Hello, world
.in .in
.\" .\"
.SS Program source: svshm_string.h .SS Program source: svshm_string.h
The following header file is included by the "reader" and "writer" programs. The following header file is included by the "reader" and "writer" programs:
.PP .PP
.in +4n .in +4n
.EX .EX
/* svshm_string.h
Licensed under GNU General Public License v2 or later.
*/
#include <sys/types.h> #include <sys/types.h>
#include <sys/ipc.h> #include <sys/ipc.h>
#include <sys/shm.h> #include <sys/shm.h>

View File

@ -78,25 +78,25 @@ lustre (since Linux 3.11),
and NFS (since Linux 2.1.116). and NFS (since Linux 2.1.116).
.TP .TP
.BR MNT_DETACH " (since Linux 2.4.11)" .BR MNT_DETACH " (since Linux 2.4.11)"
Perform a lazy unmount: make the mount point unavailable for new Perform a lazy unmount: make the mount unavailable for new
accesses, immediately disconnect the filesystem and all filesystems accesses, immediately disconnect the filesystem and all filesystems
mounted below it from each other and from the mount table, and mounted below it from each other and from the mount table, and
actually perform the unmount when the mount point ceases to be busy. actually perform the unmount when the mount ceases to be busy.
.TP .TP
.BR MNT_EXPIRE " (since Linux 2.6.8)" .BR MNT_EXPIRE " (since Linux 2.6.8)"
Mark the mount point as expired. Mark the mount as expired.
If a mount point is not currently in use, then an initial call to If a mount is not currently in use, then an initial call to
.BR umount2 () .BR umount2 ()
with this flag fails with the error with this flag fails with the error
.BR EAGAIN , .BR EAGAIN ,
but marks the mount point as expired. but marks the mount as expired.
The mount point remains expired as long as it isn't accessed The mount remains expired as long as it isn't accessed
by any process. by any process.
A second A second
.BR umount2 () .BR umount2 ()
call specifying call specifying
.B MNT_EXPIRE .B MNT_EXPIRE
unmounts an expired mount point. unmounts an expired mount.
This flag cannot be specified with either This flag cannot be specified with either
.B MNT_FORCE .B MNT_FORCE
or or
@ -176,10 +176,10 @@ are available in glibc since version 2.11.
These functions are Linux-specific and should not be used in These functions are Linux-specific and should not be used in
programs intended to be portable. programs intended to be portable.
.SH NOTES .SH NOTES
.SS umount() and shared mount points .SS umount() and shared mounts
Shared mount points cause any mount activity on a mount point, including Shared mounts cause any mount activity on a mount, including
.BR umount () .BR umount ()
operations, to be forwarded to every shared mount point in the operations, to be forwarded to every shared mount in the
peer group and every slave mount of that peer group. peer group and every slave mount of that peer group.
This means that This means that
.BR umount () .BR umount ()
@ -187,7 +187,7 @@ 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. peers to be unmounted and all of their slaves to be unmounted as well.
.PP .PP
This propagation of unmount activity can be particularly surprising This propagation of unmount activity can be particularly surprising
on systems where every mount point is shared by default. on systems where every mount is shared by default.
On such systems, On such systems,
recursively bind mounting the root directory of the filesystem recursively bind mounting the root directory of the filesystem
onto a subdirectory and then later unmounting that subdirectory with onto a subdirectory and then later unmounting that subdirectory with
@ -197,7 +197,7 @@ will cause every mount in the mount namespace to be lazily unmounted.
To ensure To ensure
.BR umount () .BR umount ()
does not propagate in this fashion, does not propagate in this fashion,
the mount point may be remounted using a the mount may be remounted using a
.BR mount (2) .BR mount (2)
call with a call with a
.I mount_flags .I mount_flags

View File

@ -76,7 +76,6 @@ On error, the terminal state is restored,
.I errno .I errno
is set to indicate the error, and NULL is returned. is set to indicate the error, and NULL is returned.
.SH ERRORS .SH ERRORS
The function may fail if
.TP .TP
.B ENXIO .B ENXIO
The process does not have a controlling terminal. The process does not have a controlling terminal.

View File

@ -868,7 +868,7 @@ rather than the current setting of the close-on-exec flag.
.I mnt_id .I mnt_id
This field, present since Linux 3.15, This field, present since Linux 3.15,
.\" commit 49d063cb353265c3af701bab215ac438ca7df36d .\" commit 49d063cb353265c3af701bab215ac438ca7df36d
is the ID of the mount point containing this file. is the ID of the mount containing this file.
See the description of See the description of
.IR /proc/[pid]/mountinfo . .IR /proc/[pid]/mountinfo .
.RE .RE
@ -1417,7 +1417,7 @@ check; see
.IR /proc/[pid]/mountinfo " (since Linux 2.6.26)" .IR /proc/[pid]/mountinfo " (since Linux 2.6.26)"
.\" This info adapted from Documentation/filesystems/proc.txt .\" This info adapted from Documentation/filesystems/proc.txt
.\" commit 2d4d4864ac08caff5c204a752bd004eed4f08760 .\" commit 2d4d4864ac08caff5c204a752bd004eed4f08760
This file contains information about mount points This file contains information about mounts
in the process's mount namespace (see in the process's mount namespace (see
.BR mount_namespaces (7)). .BR mount_namespaces (7)).
It supplies various information It supplies various information
@ -1456,21 +1456,21 @@ of any other mount at the same location.
the longest path subprefix of P that is a mount point the longest path subprefix of P that is a mount point
is not itself hidden by a stacked mount.) is not itself hidden by a stacked mount.)
.IP .IP
If the parent mount point lies outside the process's root directory (see If the parent mount lies outside the process's root directory (see
.BR chroot (2)), .BR chroot (2)),
the ID shown here won't have a corresponding record in the ID shown here won't have a corresponding record in
.I mountinfo .I mountinfo
whose mount ID (field 1) matches this parent mount ID whose mount ID (field 1) matches this parent mount ID
(because mount points that lie outside the process's root directory (because mounts that lie outside the process's root directory
are not shown in are not shown in
.IR mountinfo ). .IR mountinfo ).
As a special case of this point, As a special case of this point,
the process's root mount point may have a parent mount the process's root mount may have a parent mount
(for the initramfs filesystem) that lies (for the initramfs filesystem) that lies
.\" Miklos Szeredi, Nov 2017: The hidden one is the initramfs, I believe .\" Miklos Szeredi, Nov 2017: The hidden one is the initramfs, I believe
.\" mtk: In the initial mount namespace, this hidden ID has the value 0 .\" mtk: In the initial mount namespace, this hidden ID has the value 0
outside the process's root directory, outside the process's root directory,
and an entry for that mount point will not appear in and an entry for that mount will not appear in
.IR mountinfo . .IR mountinfo .
.TP .TP
(3) (3)
@ -1551,7 +1551,7 @@ and
.TP .TP
.IR /proc/[pid]/mountstats " (since Linux 2.6.17)" .IR /proc/[pid]/mountstats " (since Linux 2.6.17)"
This file exports information (statistics, configuration information) This file exports information (statistics, configuration information)
about the mount points in the process's mount namespace (see about the mounts in the process's mount namespace (see
.BR mount_namespaces (7)). .BR mount_namespaces (7)).
Lines in this file have the form: Lines in this file have the form:
.IP .IP
@ -1830,7 +1830,7 @@ It provides the same view of the filesystem (including namespaces and the
set of per-process mounts) as the process itself. set of per-process mounts) as the process itself.
An example illustrates this point. An example illustrates this point.
In one terminal, we start a shell in new user and mount namespaces, In one terminal, we start a shell in new user and mount namespaces,
and in that shell we create some new mount points: and in that shell we create some new mounts:
.IP .IP
.in +4n .in +4n
.EX .EX
@ -1876,9 +1876,11 @@ this symbolic link is governed by a ptrace access mode
.B PTRACE_MODE_READ_FSCREDS .B PTRACE_MODE_READ_FSCREDS
check; see check; see
.BR ptrace (2). .BR ptrace (2).
.\" FIXME Describe /proc/[pid]/projid_map .TP
.\" Added in 3.7 .IR /proc/[pid]/projid_map " (since Linux 3.7)"
.\" commit f76d207a66c3a53defea67e7d36c3eb1b7d6d61d .\" commit f76d207a66c3a53defea67e7d36c3eb1b7d6d61d
See
.BR user_namespaces (7).
.TP .TP
.IR /proc/[pid]/seccomp " (Linux 2.6.12 to 2.6.22)" .IR /proc/[pid]/seccomp " (Linux 2.6.12 to 2.6.22)"
This file can be used to read and change the process's This file can be used to read and change the process's
@ -2972,7 +2974,7 @@ only the (weaker)
.B CAP_SYS_NICE .B CAP_SYS_NICE
capability is required to access this file. capability is required to access this file.
.TP .TP
.IR /proc/[pid]/uid_map ", " /proc/[pid]/gid_map " (since Linux 3.5)" .IR /proc/[pid]/uid_map " (since Linux 3.5)"
See See
.BR user_namespaces (7). .BR user_namespaces (7).
.TP .TP
@ -3822,7 +3824,7 @@ With the introduction of per-process mount namespaces in Linux 2.4.19 (see
.BR mount_namespaces (7)), .BR mount_namespaces (7)),
this file became a link to this file became a link to
.IR /proc/self/mounts , .IR /proc/self/mounts ,
which lists the mount points of the process's own mount namespace. which lists the mounts of the process's own mount namespace.
The format of this file is documented in The format of this file is documented in
.BR fstab (5). .BR fstab (5).
.TP .TP

View File

@ -222,7 +222,7 @@ and
controllers against one hierarchy, and to mount the controllers against one hierarchy, and to mount the
.I cpu .I cpu
controller alone against another hierarchy. controller alone against another hierarchy.
It is possible to create multiple mount points with exactly It is possible to create multiple mount with exactly
the same set of comounted controllers. the same set of comounted controllers.
However, in this case all that results is multiple mount points However, in this case all that results is multiple mount points
providing a view of the same hierarchy. providing a view of the same hierarchy.
@ -231,7 +231,7 @@ Note that on many systems, the v1 controllers are automatically mounted under
.IR /sys/fs/cgroup ; .IR /sys/fs/cgroup ;
in particular, in particular,
.BR systemd (1) .BR systemd (1)
automatically creates such mount points. automatically creates such mounts.
.\" .\"
.SS Unmounting v1 controllers .SS Unmounting v1 controllers
A mounted cgroup filesystem can be unmounted using the A mounted cgroup filesystem can be unmounted using the
@ -250,7 +250,7 @@ that is, it has no child cgroups.
If this is not the case, then the only effect of the If this is not the case, then the only effect of the
.BR umount (8) .BR umount (8)
is to make the mount invisible. is to make the mount invisible.
Thus, to ensure that the mount point is really removed, Thus, to ensure that the mount is really removed,
one must first remove all child cgroups, one must first remove all child cgroups,
which in turn can be done only after all member processes which in turn can be done only after all member processes
have been moved from those cgroups to the root cgroup. have been moved from those cgroups to the root cgroup.

View File

@ -57,7 +57,7 @@ system call creates and initializes an fanotify notification group
and returns a file descriptor referring to it. and returns a file descriptor referring to it.
.PP .PP
An fanotify notification group is a kernel-internal object that holds An fanotify notification group is a kernel-internal object that holds
a list of files, directories, filesystems, and mount points for which a list of files, directories, filesystems, and mounts for which
events shall be created. events shall be created.
.PP .PP
For each entry in an fanotify notification group, two bit masks exist: the For each entry in an fanotify notification group, two bit masks exist: the
@ -67,20 +67,20 @@ mask and the
mask. mask.
The mark mask defines file activities for which an event shall be created. The mark mask defines file activities for which an event shall be created.
The ignore mask defines activities for which no event shall be generated. The ignore mask defines activities for which no event shall be generated.
Having these two types of masks permits a filesystem, mount point, or Having these two types of masks permits a filesystem, mount, or
directory to be marked for receiving events, while at the same time directory to be marked for receiving events, while at the same time
ignoring events for specific objects under a mount point or directory. ignoring events for specific objects under a mount or directory.
.PP .PP
The The
.BR fanotify_mark (2) .BR fanotify_mark (2)
system call adds a file, directory, filesystem, or mount point to a system call adds a file, directory, filesystem, or mount to a
notification group and specifies which events notification group and specifies which events
shall be reported (or ignored), or removes or modifies such an entry. shall be reported (or ignored), or removes or modifies such an entry.
.PP .PP
A possible usage of the ignore mask is for a file cache. A possible usage of the ignore mask is for a file cache.
Events of interest for a file cache are modification of a file and closing Events of interest for a file cache are modification of a file and closing
of the same. of the same.
Hence, the cached directory or mount point is to be marked to receive these Hence, the cached directory or mount is to be marked to receive these
events. events.
After receiving the first event informing that a file has been modified, After receiving the first event informing that a file has been modified,
the corresponding cache entry will be invalidated. the corresponding cache entry will be invalidated.
@ -764,7 +764,7 @@ The two example programs below demonstrate the usage of the fanotify API.
The first program is an example of fanotify being The first program is an example of fanotify being
used with its event object information passed in the form of a file used with its event object information passed in the form of a file
descriptor. descriptor.
The program marks the mount point passed as a command-line argument and The program marks the mount passed as a command-line argument and
waits for events of type waits for events of type
.B FAN_OPEN_PERM .B FAN_OPEN_PERM
and and

View File

@ -302,7 +302,7 @@ that process to mount
.I /proc .I /proc
filesystems. filesystems.
.PP .PP
Note however, that mounting block-based filesystems can be done Note, however, that mounting block-based filesystems can be done
only by a process that holds only by a process that holds
.BR CAP_SYS_ADMIN .BR CAP_SYS_ADMIN
in the initial user namespace. in the initial user namespace.
@ -518,7 +518,7 @@ files.
The lines written to The lines written to
.IR uid_map .IR uid_map
.RI ( gid_map ) .RI ( gid_map )
must conform to the following rules: must conform to the following validity rules:
.IP * 3 .IP * 3
The three fields must be valid numbers, The three fields must be valid numbers,
and the last field must be greater than 0. and the last field must be greater than 0.
@ -561,7 +561,7 @@ Writes that violate the above rules fail with the error
In order for a process to write to the In order for a process to write to the
.I /proc/[pid]/uid_map .I /proc/[pid]/uid_map
.RI ( /proc/[pid]/gid_map ) .RI ( /proc/[pid]/gid_map )
file, all of the following requirements must be met: file, all of the following permission requirements must be met:
.IP 1. 3 .IP 1. 3
The writing process must have the The writing process must have the
.BR CAP_SETUID .BR CAP_SETUID
@ -669,6 +669,48 @@ Writes that violate the above rules fail with the error
.\" .\"
.\" ============================================================ .\" ============================================================
.\" .\"
.SS Project ID mappings: projid_map
Similarly to user and group ID mappings,
it is possible to create project ID mappings for a user namespace.
(Project IDs are used for disk quotas; see
.BR setquota (8)
and
.BR quotactl (2).)
.PP
Project ID mappings are defined by writing to the
.I /proc/[pid]/projid_map
file (present since
.\" commit f76d207a66c3a53defea67e7d36c3eb1b7d6d61d
Linux 3.7).
.PP
The validity rules for writing to the
.I /proc/[pid]/projid_map
file are as for writing to the
.I uid_map
file; violation of these rules causes
.BR write (2)
to fail with the error
.BR EINVAL .
.PP
The permission rules for writing to the
.I /proc/[pid]/projid_map
file are as follows:
.IP 1. 3
The writing process must either be in the user namespace of the process
.I pid
or be in the parent user namespace of the process
.IR pid .
.IP 2.
The mapped project IDs must in turn have a mapping
in the parent user namespace.
.PP
Violation of these rules causes
.BR write (2)
to fail with the error
.BR EPERM .
.\"
.\" ============================================================
.\"
.SS Interaction with system calls that change process UIDs or GIDs .SS Interaction with system calls that change process UIDs or GIDs
In a user namespace where the In a user namespace where the
.I uid_map .I uid_map