From: Andrew Morton git-nfs adds new /proc things. Cc: "Eric W. Biederman" Cc: Trond Myklebust Signed-off-by: Andrew Morton --- fs/proc/base.c | 18 +++++++++++------- 1 files changed, 11 insertions(+), 7 deletions(-) diff -puN fs/proc/base.c~proc-dont-lock-task_structs-indefinitely-git-nfs-fix fs/proc/base.c --- devel/fs/proc/base.c~proc-dont-lock-task_structs-indefinitely-git-nfs-fix 2006-02-28 00:07:02.000000000 -0800 +++ devel-akpm/fs/proc/base.c 2006-02-28 00:16:07.000000000 -0800 @@ -626,17 +626,21 @@ static struct file_operations proc_mount extern struct seq_operations mountstats_op; static int mountstats_open(struct inode *inode, struct file *file) { - struct task_struct *task = proc_task(inode); int ret = seq_open(file, &mountstats_op); if (!ret) { struct seq_file *m = file->private_data; - struct namespace *namespace; - task_lock(task); - namespace = task->namespace; - if (namespace) - get_namespace(namespace); - task_unlock(task); + struct namespace *namespace = NULL; + struct task_struct *task = get_proc_task(inode); + + if (task) { + task_lock(task); + namespace = task->namespace; + if (namespace) + get_namespace(namespace); + task_unlock(task); + put_task_struct(task); + } if (namespace) m->private = namespace; _