diff options
| author | Michael Kerrisk <mtk.manpages@gmail.com> | 2019-07-30 22:59:17 +0200 |
|---|---|---|
| committer | Michael Kerrisk <mtk.manpages@gmail.com> | 2019-09-23 13:11:19 +0200 |
| commit | eb9078a7a96a8137619e5fd16d77c1a749942842 (patch) | |
| tree | aaa56688037d2391abcf4d01d21eb3f2eec47348 | |
| parent | fc17fc65024a10161e2334711fbd22e7d69665c7 (diff) | |
| download | man-pages-eb9078a7a96a8137619e5fd16d77c1a749942842.tar.gz | |
pivot_root.2: Remove text describing case where current root is not a mount point
One kernel printk() later, my suspicions seem confirmed: the text
describing the situation where the current root is not a mount
point (because of a chroot()) seems to be bogus. (Perhaps it was
true once upon a time.) In my testing, if the current root is not
a mount point, an EINVAL error results.
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
| -rw-r--r-- | man2/pivot_root.2 | 20 |
1 files changed, 7 insertions, 13 deletions
diff --git a/man2/pivot_root.2 b/man2/pivot_root.2 index 6853e9bd9a..f4e29cc620 100644 --- a/man2/pivot_root.2 +++ b/man2/pivot_root.2 @@ -94,19 +94,8 @@ similarly, if .I put_old is an existing mount point, its propagation type must not be .BR MS_SHARED . -.\" FIXME -.\" mtk: I am very suspicious of the following paragraph. My testing suggests -.\" that pivot_root() fails with the error EINVAL in the case where -.\" the current root (after chroot()) is not a mount point. And tehre are -.\" these lines in pivot_root(): -.\" error = -EINVAL; -.\" if (root.mnt->mnt_root != root.dentry) -.\" goto out4; /* not a mountpoint */ -.PP -If the current root is not a mount point (e.g., after an earlier -.BR chroot (2)), -then the mount point of the filesystem containing the current root directory -(i.e., not the directory itself) is mounted on \fIput_old\fP. +.IP \- +The current root directory must be a mount point. .SH RETURN VALUE On success, zero is returned. On error, \-1 is returned, and @@ -149,6 +138,11 @@ is not a mount point. \fIput_old\fP is not underneath \fInew_root\fP. .TP .B EINVAL +The current root directory is not a mount point +(because of an earlier +.BR chroot (2)). +.TP +.B EINVAL The current root is on the rootfs (initial ramfs) filesystem; see NOTES. .TP .B EINVAL |
