Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1761867AbXJZTti (ORCPT ); Fri, 26 Oct 2007 15:49:38 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751905AbXJZTtb (ORCPT ); Fri, 26 Oct 2007 15:49:31 -0400 Received: from ebiederm.dsl.xmission.com ([166.70.28.69]:52841 "EHLO ebiederm.dsl.xmission.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751301AbXJZTta (ORCPT ); Fri, 26 Oct 2007 15:49:30 -0400 From: ebiederm@xmission.com (Eric W. Biederman) To: Linus Torvalds Cc: Andrew Morton , Al Viro , linux-kernel@vger.kernel.org, Pavel Emelyanov , Sukadev Bhattiprolu , Linux Containers Subject: [PATCH] proc: Simplify and correct proc_flush_task References: Date: Fri, 26 Oct 2007 13:43:28 -0600 In-Reply-To: (Linus Torvalds's message of "Fri, 26 Oct 2007 11:06:52 -0700 (PDT)") Message-ID: User-Agent: Gnus/5.110006 (No Gnus v0.6) Emacs/21.4 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1595 Lines: 53 Currently we special case when we have only the initial pid namespace. Unfortunately in doing so the copied case for the other namespaces was broken so we don't properly flush the thread directories :( So this patch removes the unnecessary special case (removing a usage of proc_mnt) and corrects the flushing of the thread directories. Signed-off-by: Eric W. Biederman --- fs/proc/base.c | 15 ++++++--------- 1 files changed, 6 insertions(+), 9 deletions(-) diff --git a/fs/proc/base.c b/fs/proc/base.c index aeaf0d0..a17c268 100644 --- a/fs/proc/base.c +++ b/fs/proc/base.c @@ -2328,21 +2328,18 @@ out: void proc_flush_task(struct task_struct *task) { - int i, leader; - struct pid *pid, *tgid; + int i; + struct pid *pid, *tgid = NULL; 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; + if (thread_group_leader(task)) + tgid = task_tgid(task); - tgid = task_tgid(task); - for (i = 1; i <= pid->level; i++) { + for (i = 0; i <= pid->level; i++) { upid = &pid->numbers[i]; proc_flush_task_mnt(upid->ns->proc_mnt, upid->nr, - leader ? 0 : tgid->numbers[i].nr); + tgid ? tgid->numbers[i].nr : 0); } upid = &pid->numbers[pid->level]; -- 1.5.3.rc6.17.g1911 - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/