PATCH: Lock tty directly in acct layer
Signed-off-by Alan Cox <[email protected]>
kernel/acct.c +2 -2
@@ -483,10 +484,10 @@ ac.ac_ppid = current->parent->tgid;#endif -read_lock (&tasklist_lock);/* pin current->signal */ +mutex_lock (&tty_mutex); ac.ac_tty = current->signal->tty ?old_encode_dev (tty_devnum (current->signal->tty)) :0 ; -read_unlock (&tasklist_lock); +mutex_unlock (&tty_mutex);spin_lock_irq (¤t->sighand->siglock); ac.ac_utime =encode_comp_t (jiffies_to_AHZ (cputime_to_jiffies (pacct->ac_utime)));
kernel/acct.c line 488
Quoted 12 lines · Alan Cox
Signed-off-by Alan Cox <[email protected]>diff -u --new-file --recursive --exclude-from
/usr/src/excludelinux.vanilla-2.6.18-rc4-mm1/kernel/acct.clinux-2.6.18-rc4-mm1/kernel/acct.ckernel/acct.c +1
-1@@ -483,10 +484,10 @@ ac.ac_ppid = current->parent->tgid;#endif -read_lock (&tasklist_lock);/* pin current->signal */ +mutex_lock (&tty_mutex); ac.ac_tty = current->signal->tty ?
but.. can't ->signal still change, even if signal->tty isn't ?
Signature · 1 line
if you want to mail me at work (you don't), use arjan (at) linux.intel.com
Ar Mer, 2006-08-16 am 18:24 +0200, ysgrifennodd Arjan van de Ven:
Quoted 5 lines
kernel/acct.c line 488
Quoted 3 lines
kernel/acct.c +1
-1-read_lock (&tasklist_lock);/* pin current->signal */ +mutex_lock (&tty_mutex); ac.ac_tty = current->signal->tty ?but.. can't ->signal still change, even if
signal->ttyisn't ?
I'm not sure, thats a good question (as if so is how to lock it). Will investigate.