Re: [patch 1/4] fs, proc: Introduce /proc/<pid>/task/<tid>/childrenentry v8

From: Kees Cook
Date: Mon Jan 23 2012 - 13:54:52 EST


On Mon, Jan 23, 2012 at 6:20 AM, Cyrill Gorcunov <gorcunov@xxxxxxxxxx> wrote:
> When we do checkpoint of a task we need to know the list of children
> the task, has but there is no easy and fast way to generate reverse
> parent->children chain from arbitrary <pid> (while a parent pid is
> provided in "PPid" field of /proc/<pid>/status).
> [...]
> Signed-off-by: Cyrill Gorcunov <gorcunov@xxxxxxxxxx>
> Reviewed-by: Oleg Nesterov <oleg@xxxxxxxxxx>
> Cc: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
> Cc: Pavel Emelyanov <xemul@xxxxxxxxxxxxx>
> Cc: Serge Hallyn <serge.hallyn@xxxxxxxxxxxxx>
> Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@xxxxxxxxxxxxxx>

Reviewed-by: Kees Cook <keescook@xxxxxxxxxxxx>

> +static int children_seq_show(struct seq_file *seq, void *v)
> +{
> +       struct inode *inode = seq->private;
> +       pid_t pid;
> +
> +       pid = pid_nr_ns(v, inode->i_sb->s_fs_info);
> +       return seq_printf(seq, " %d", pid);
> +}

Does this mean the file contents always starts with a space? I think
I'd prefer a trailing space than a leading one. Better yet, neither.
:)

-Kees

--
Kees Cook
ChromeOS Security
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/