]> git.ipfire.org Git - thirdparty/man-pages.git/commitdiff
proc.5: Rework the description of /proc/PID/mountinfo parent-ID field
authorMichael Kerrisk <mtk.manpages@gmail.com>
Mon, 20 Nov 2017 08:59:43 +0000 (09:59 +0100)
committerMichael Kerrisk <mtk.manpages@gmail.com>
Mon, 20 Nov 2017 09:37:33 +0000 (10:37 +0100)
After comments from Miklos, and further digging in the kernel
source that showed that chroot() can also result in "hidden"
parent-IDs in mountinfo, I've revised the description of
mountinfo.

In fs/proc_namespace.cs::how_mountinfo() there is:

        /* mountpoints outside of chroot jail will give SEQ_SKIP on this */
        err = seq_path_root(m, &mnt_path, &p->root, " \t\n\\");
        if (err)
                goto out;

I instrumented the 'if (err)' code path with printk()
to show that there is indeed a record corresponding to the
parent-ID for the process root that is being skipped.

Reported-by: Miklos Szeredi <mszeredi@redhat.com>
Reviewed-by: Miklos Szeredi <mszeredi@redhat.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
man5/proc.5

index 92c49f93f6595b6ae2e0bf10891786c13bda2cad..f9241b51fd326d46c2fa9e9b0d754a64aba99436 100644 (file)
@@ -1243,16 +1243,25 @@ mount ID: a unique ID for the mount (may be reused after
 .BR umount (2)).
 .TP
 (2)
-parent ID: the ID of the parent mount.
-For the root mount point,
-the ID shown here is a hidden mount ID associated with the mount namespace.
-That ID is distinct from any of the IDs shown in
-field (1) of the records shown in the
-.I mountinfo
-file, and does not appear in field (1) in the
+parent ID: the ID of the parent mount
+(or of self for the root of this mount namespace's mount tree).
+.IP
+If the parent mount point lies outside the process's root directory (see
+.BR chroot (2)),
+the ID shown here won't have a corresponding record in
 .I mountinfo
-file in any other mount namespace.
-(In the initial mount namespace, this hidden ID has the value 0.)
+whose mount ID (field 1) matches this parent mount ID
+(because mount points that lie outside the process's root directory
+are not shown in
+.IR mountinfo ).
+As a special case of this point,
+the process's root mount point may have a parent mount
+(for the initramfs filesystem) that lies
+.\" 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
+outside the process's root directory,
+and an entry for that mount point will not appear in
+.IR mountinfo .
 .TP
 (3)
 major:minor: the value of