aboutsummaryrefslogtreecommitdiffstats
path: root/fs/proc/base.c
diff options
context:
space:
mode:
authorJeff Garzik <jeff@garzik.org>2007-02-02 08:31:55 -0500
committerJeff Garzik <jeff@garzik.org>2007-02-02 08:31:55 -0500
commitae2c27a78f1df5b0967069cd3b916cff1eb044c8 (patch)
treee67f1012e76185bac2e78bb04caa68ed1f7dc2a2 /fs/proc/base.c
parenta608ab9cb6a5050394498b2520c6e7c162f4e2cf (diff)
parente34efe3b100d0fbdf053128956c3dd0bc68754d6 (diff)
Merge ../linux-2.6
Diffstat (limited to 'fs/proc/base.c')
-rw-r--r--fs/proc/base.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/fs/proc/base.c b/fs/proc/base.c
index ff7a66850602..1a979ea3b379 100644
--- a/fs/proc/base.c
+++ b/fs/proc/base.c
@@ -2328,13 +2328,23 @@ static int proc_task_readdir(struct file * filp, void * dirent, filldir_t filldi
2328{ 2328{
2329 struct dentry *dentry = filp->f_path.dentry; 2329 struct dentry *dentry = filp->f_path.dentry;
2330 struct inode *inode = dentry->d_inode; 2330 struct inode *inode = dentry->d_inode;
2331 struct task_struct *leader = get_proc_task(inode); 2331 struct task_struct *leader = NULL;
2332 struct task_struct *task; 2332 struct task_struct *task;
2333 int retval = -ENOENT; 2333 int retval = -ENOENT;
2334 ino_t ino; 2334 ino_t ino;
2335 int tid; 2335 int tid;
2336 unsigned long pos = filp->f_pos; /* avoiding "long long" filp->f_pos */ 2336 unsigned long pos = filp->f_pos; /* avoiding "long long" filp->f_pos */
2337 2337
2338 task = get_proc_task(inode);
2339 if (!task)
2340 goto out_no_task;
2341 rcu_read_lock();
2342 if (pid_alive(task)) {
2343 leader = task->group_leader;
2344 get_task_struct(leader);
2345 }
2346 rcu_read_unlock();
2347 put_task_struct(task);
2338 if (!leader) 2348 if (!leader)
2339 goto out_no_task; 2349 goto out_no_task;
2340 retval = 0; 2350 retval = 0;