Skip to content

Commit

Permalink
[PATCH] do_acct_process(): don't take tty_mutex
Browse files Browse the repository at this point in the history
No need to take the global tty_mutex, signal->tty->driver can't go away while
we are holding ->siglock.

Signed-off-by: Oleg Nesterov <[email protected]>
Acked-by: Peter Zijlstra <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
Oleg Nesterov authored and Linus Torvalds committed Dec 8, 2006
1 parent 9159350 commit 7bcfa95
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions kernel/acct.c
Original file line number Diff line number Diff line change
Expand Up @@ -485,12 +485,9 @@ static void do_acct_process(struct file *file)
ac.ac_ppid = current->parent->tgid;
#endif

mutex_lock(&tty_mutex);
tty = get_current_tty();
ac.ac_tty = tty ? old_encode_dev(tty_devnum(tty)) : 0;
mutex_unlock(&tty_mutex);

spin_lock_irq(&current->sighand->siglock);
tty = current->signal->tty;
ac.ac_tty = tty ? old_encode_dev(tty_devnum(tty)) : 0;
ac.ac_utime = encode_comp_t(jiffies_to_AHZ(cputime_to_jiffies(pacct->ac_utime)));
ac.ac_stime = encode_comp_t(jiffies_to_AHZ(cputime_to_jiffies(pacct->ac_stime)));
ac.ac_flag = pacct->ac_flag;
Expand Down

0 comments on commit 7bcfa95

Please sign in to comment.