Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 43492
b: refs/heads/master
c: 9159350
h: refs/heads/master
v: v3
  • Loading branch information
Oleg Nesterov authored and Linus Torvalds committed Dec 8, 2006
1 parent 0158052 commit 1035a22
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 13 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: 24ec839c431eb79bb8f6abc00c4e1eb3b8c4d517
refs/heads/master: 915935041281c64589e2b7fe38437be22567fb6f
16 changes: 4 additions & 12 deletions trunk/fs/proc/array.c
Original file line number Diff line number Diff line change
Expand Up @@ -346,20 +346,13 @@ static int do_task_stat(struct task_struct *task, char * buffer, int whole)
sigemptyset(&sigcatch);
cutime = cstime = utime = stime = cputime_zero;

mutex_lock(&tty_mutex);
rcu_read_lock();
if (lock_task_sighand(task, &flags)) {
struct signal_struct *sig = task->signal;
struct tty_struct *tty = sig->tty;

if (tty) {
/*
* sig->tty is not stable, but tty_mutex
* protects us from release_dev(tty)
*/
barrier();
tty_pgrp = tty->pgrp;
tty_nr = new_encode_dev(tty_devnum(tty));

if (sig->tty) {
tty_pgrp = sig->tty->pgrp;
tty_nr = new_encode_dev(tty_devnum(sig->tty));
}

num_threads = atomic_read(&sig->count);
Expand Down Expand Up @@ -395,7 +388,6 @@ static int do_task_stat(struct task_struct *task, char * buffer, int whole)
unlock_task_sighand(task, &flags);
}
rcu_read_unlock();
mutex_unlock(&tty_mutex);

if (!whole || num_threads<2)
wchan = get_wchan(task);
Expand Down

0 comments on commit 1035a22

Please sign in to comment.