linux-api.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] [RFC] fs, proc: don't guard /proc/<pid>/task/<tid>/children on CONFIG_CHECKPOINT_RESTORE
@ 2015-05-21 10:30 Alban Crequy
  2015-05-21 20:57 ` Andrew Morton
       [not found] ` <1432204221-1933-1-git-send-email-alban-973cpzSjLbNWk0Htik3J/w@public.gmane.org>
  0 siblings, 2 replies; 10+ messages in thread
From: Alban Crequy @ 2015-05-21 10:30 UTC (permalink / raw)
  To: Cyrill Gorcunov
  Cc: Oleg Nesterov, Kees Cook, Pavel Emelyanov, Serge Hallyn,
	KAMEZAWA Hiroyuki, linux-api-u79uwXL29TY76Z2rM5mHXA,
	Alexander Viro, linux-fsdevel-u79uwXL29TY76Z2rM5mHXA,
	Andrew Morton, Alban Crequy, Iago Lopez Galeiras

From: Alban Crequy <alban-973cpzSjLbNWk0Htik3J/w@public.gmane.org>

commit 818411616baf ("fs, proc: introduce
/proc/<pid>/task/<tid>/children entry") introduced the children entry
for checkpoint restore and the file is only available on kernels
configured with CONFIG_EXPERT and CONFIG_CHECKPOINT_RESTORE.

This is available in most distributions (Fedora, Debian, Ubuntu, CoreOS)
because they usually enable CONFIG_EXPERT and CONFIG_CHECKPOINT_RESTORE.
But Arch does not enable CONFIG_EXPERT or CONFIG_CHECKPOINT_RESTORE.

However, the children proc file is useful outside of checkpoint restore.
I would like to use it in rkt. The rkt process exec() another program it
does not control, and that other program will fork()+exec() a child
process. I would like to find the pid of the child process from an
external tool without iterating in /proc over all processes to find
which one has a parent pid equal to rkt.

Since the children proc file is useful outside of checkpoint-restore,
I am removing the guard on CONFIG_CHECKPOINT_RESTORE.

Signed-off-by: Alban Crequy <alban-973cpzSjLbNWk0Htik3J/w@public.gmane.org>
Cc: Iago Lopez Galeiras <iago-973cpzSjLbNWk0Htik3J/w@public.gmane.org>
---
 fs/proc/array.c | 2 --
 fs/proc/base.c  | 2 --
 2 files changed, 4 deletions(-)

diff --git a/fs/proc/array.c b/fs/proc/array.c
index fd02a9e..6edec57 100644
--- a/fs/proc/array.c
+++ b/fs/proc/array.c
@@ -569,7 +569,6 @@ int proc_pid_statm(struct seq_file *m, struct pid_namespace *ns,
 	return 0;
 }
 
-#ifdef CONFIG_CHECKPOINT_RESTORE
 static struct pid *
 get_children_pid(struct inode *inode, struct pid *pid_prev, loff_t pos)
 {
@@ -692,4 +691,3 @@ const struct file_operations proc_tid_children_operations = {
 	.llseek  = seq_lseek,
 	.release = children_seq_release,
 };
-#endif /* CONFIG_CHECKPOINT_RESTORE */
diff --git a/fs/proc/base.c b/fs/proc/base.c
index 093ca14..b743007 100644
--- a/fs/proc/base.c
+++ b/fs/proc/base.c
@@ -2922,9 +2922,7 @@ static const struct pid_entry tid_base_stuff[] = {
 	ONE("stat",      S_IRUGO, proc_tid_stat),
 	ONE("statm",     S_IRUGO, proc_pid_statm),
 	REG("maps",      S_IRUGO, proc_tid_maps_operations),
-#ifdef CONFIG_CHECKPOINT_RESTORE
 	REG("children",  S_IRUGO, proc_tid_children_operations),
-#endif
 #ifdef CONFIG_NUMA
 	REG("numa_maps", S_IRUGO, proc_tid_numa_maps_operations),
 #endif
-- 
2.1.4

^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2015-05-27  7:29 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-05-21 10:30 [PATCH] [RFC] fs, proc: don't guard /proc/<pid>/task/<tid>/children on CONFIG_CHECKPOINT_RESTORE Alban Crequy
2015-05-21 20:57 ` Andrew Morton
2015-05-22 12:47   ` [PATCH] fs, proc: introduce CONFIG_PROC_CHILDREN Iago López Galeiras
     [not found]     ` <1432298859-2059-1-git-send-email-iago-973cpzSjLbNWk0Htik3J/w@public.gmane.org>
2015-05-22 15:37       ` Cyrill Gorcunov
2015-05-26 15:07         ` Djalal Harouni
2015-05-26 15:12         ` [PATCH v3] " Iago López Galeiras
     [not found]           ` <1432653162-20973-1-git-send-email-iago-973cpzSjLbNWk0Htik3J/w@public.gmane.org>
2015-05-27  7:29             ` Cyrill Gorcunov
     [not found] ` <1432204221-1933-1-git-send-email-alban-973cpzSjLbNWk0Htik3J/w@public.gmane.org>
2015-05-21 21:47   ` [PATCH] [RFC] fs, proc: don't guard /proc/<pid>/task/<tid>/children on CONFIG_CHECKPOINT_RESTORE Andy Lutomirski
     [not found]     ` <CALCETrVbaKnqj7qLBr+ufirPHfdjAYzo6_e362N0muVGnH7HTg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-05-21 22:05       ` Cyrill Gorcunov
2015-05-22 12:49       ` Alban Crequy

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).