From: Oleg Nesterov Date: Fri, 8 Dec 2006 10:36:07 +0000 (-0800) Subject: [PATCH] do_acct_process(): don't take tty_mutex X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=7bcfa95e561f11a17720162935e4f704c5d6fda3;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git [PATCH] do_acct_process(): don't take tty_mutex 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 Acked-by: Peter Zijlstra Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/kernel/acct.c b/kernel/acct.c index ca5619039367..69a40c9777a2 100644 --- a/kernel/acct.c +++ b/kernel/acct.c @@ -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(¤t->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;