[PATCH 14/20] Make proc_flush_task() actually from entries from multiple namespaces



This means that proc_flush_task_mnt() is to be called for many proc
mounts and with different ids, depending on the namespace this pid
is to be flushed from.

Signed-off-by: Pavel Emelyanov <xemul@xxxxxxxxxx>
Cc: Oleg Nesterov <oleg@xxxxxxxxxx>

---

base.c | 18 ++++++++++++++++--
1 files changed, 16 insertions(+), 2 deletions(-)

--- ./fs/proc/base.c.ve12 2007-08-06 14:58:51.000000000 +0400
+++ ./fs/proc/base.c 2007-08-06 14:58:51.000000000 +0400
@@ -2170,8 +2170,22 @@ out:

void proc_flush_task(struct task_struct *task)
{
- proc_flush_task_mnt(proc_mnt, task->pid,
- thread_group_leader(task) ? 0 : task->tgid);
+ int i, leader;
+ struct pid *pid, *tgid;
+ struct upid *upid;
+
+ leader = thread_group_leader(task);
+ proc_flush_task_mnt(proc_mnt, task->pid, leader ? task->tgid : 0);
+ pid = task_pid(task);
+ if (pid->level == 0)
+ return;
+
+ tgid = task_tgid(task);
+ for (i = 1; i <= pid->level; i++) {
+ upid = &pid->numbers[i];
+ proc_flush_task_mnt(upid->ns->proc_mnt, upid->nr,
+ leader ? 0 : tgid->numbers[i].nr);
+ }
}

static struct dentry *proc_pid_instantiate(struct inode *dir,

-
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/



Relevant Pages

  • Re: [PATCH 2/4] autofs4 - track uid and gid of last mount requester
    ... So as long as a daemon can serve multiple pid namespaces (which ... pid namespace, and put that into the packet at ... And so what we're trying to decide is whether autofs should send ...
    (Linux-Kernel)
  • Re: [PATCH 0/16] Pid namespaces
    ... | configurable, zero overheaded;) pid namespaces. ... | The namespace are organized as a tree - once a task is cloned ... Suka's patches change the kernel/pid.c code too heavy. ... | numerical pid from the kernel at all. ...
    (Linux-Kernel)
  • Re: [PATCH 0/16] Pid namespaces
    ... configurable, zero overheaded;) pid namespaces. ... The namespace are organized as a tree - once a task is cloned ... Suka's patches change the kernel/pid.c code too heavy. ... This set keeps the kernel code look like it was without ...
    (Linux-Kernel)
  • Re: signal handling description for Michaels CLONE_NEWPID man page
    ... Here is the proposal for a description of signals handling in pid ... +to a process whose PID belongs to the same namespace as the caller. ... the sender pid will be seen by the receiver as a 0 value ...
    (Linux-Kernel)
  • Re: [PATCH 1/2] kill_something_info: misc cleanups
    ... Oleg Nesterov writes: ... The difficult part is the recursive nature of the pid namespace. ... can't really keep a separate process list for each. ... I don't understand what is the purpose of pid namespace. ...
    (Linux-Kernel)