pidfd: add NSpid entries to fdinfo
authorChristian Kellner <christian@kellner.me>
Mon, 14 Oct 2019 16:20:32 +0000 (18:20 +0200)
committerChristian Brauner <christian.brauner@ubuntu.com>
Tue, 15 Oct 2019 10:17:00 +0000 (12:17 +0200)
commit15d42eb26bdee47c0278fbdab4198577bc6a97b5
tree1ae7b86c0dc4e1502178307497ca1392b633b7fd
parent4f5cafb5cb8471e54afdc9054d973535614f7675
pidfd: add NSpid entries to fdinfo

Currently, the fdinfo file contains the Pid field which shows the
pid a given pidfd refers to in the pid namespace of the procfs
instance. If pid namespaces are configured, also show an NSpid field
for easy retrieval of the pid in all descendant pid namespaces. If
the pid namespace of the process is not a descendant of the pid
namespace of the procfs instance 0 will be shown as its first NSpid
entry and no other entries will be shown. Add a block comment to
pidfd_show_fdinfo with a detailed explanation of Pid and NSpid fields.

Co-developed-by: Christian Brauner <christian.brauner@ubuntu.com>
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
Signed-off-by: Christian Kellner <christian@kellner.me>
Reviewed-by: Christian Brauner <christian.brauner@ubuntu.com>
Link: https://lore.kernel.org/r/20191014162034.2185-1-ckellner@redhat.com
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
kernel/fork.c