Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 46030
b: refs/heads/master
c: 7d89524
h: refs/heads/master
v: v3
  • Loading branch information
Guillaume Chazarain authored and Linus Torvalds committed Feb 2, 2007
1 parent 1a6fd53 commit 3798ea2
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 432bd6cbf9f016f5480153b1cdfbd046f8d4fb1e
refs/heads/master: 7d8952440f4090522b740257f1c6b2cf96413969
12 changes: 11 additions & 1 deletion trunk/fs/proc/base.c
Original file line number Diff line number Diff line change
Expand Up @@ -2328,13 +2328,23 @@ static int proc_task_readdir(struct file * filp, void * dirent, filldir_t filldi
{
struct dentry *dentry = filp->f_path.dentry;
struct inode *inode = dentry->d_inode;
struct task_struct *leader = get_proc_task(inode);
struct task_struct *leader = NULL;
struct task_struct *task;
int retval = -ENOENT;
ino_t ino;
int tid;
unsigned long pos = filp->f_pos; /* avoiding "long long" filp->f_pos */

task = get_proc_task(inode);
if (!task)
goto out_no_task;
rcu_read_lock();
if (pid_alive(task)) {
leader = task->group_leader;
get_task_struct(leader);
}
rcu_read_unlock();
put_task_struct(task);
if (!leader)
goto out_no_task;
retval = 0;
Expand Down

0 comments on commit 3798ea2

Please sign in to comment.