mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* Re: PATCH: Lock tty directly in acct layer
  2006-08-16 16:36 PATCH: Lock tty directly in acct layer Alan Cox
@ 2006-08-16 16:24 ` Arjan van de Ven
  2006-08-16 17:09   ` Alan Cox
  0 siblings, 1 reply; 3+ messages in thread
From: Arjan van de Ven @ 2006-08-16 16:24 UTC (permalink / raw)
  To: Alan Cox; +Cc: akpm, linux-kernel

On Wed, 2006-08-16 at 17:36 +0100, Alan Cox wrote:
> Signed-off-by: Alan Cox <alan@redhat.com>
> 
> diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla-2.6.18-rc4-mm1/kernel/acct.c linux-2.6.18-rc4-mm1/kernel/acct.c
> --- linux.vanilla-2.6.18-rc4-mm1/kernel/acct.c	2006-08-15 15:40:19.000000000 +0100
> +++ linux-2.6.18-rc4-mm1/kernel/acct.c	2006-08-15 16:03:18.000000000 +0100
> @@ -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 ?



-- 
if you want to mail me at work (you don't), use arjan (at) linux.intel.com


^ permalink raw reply	[flat|nested] 3+ messages in thread

* PATCH: Lock tty directly in acct layer
@ 2006-08-16 16:36 Alan Cox
  2006-08-16 16:24 ` Arjan van de Ven
  0 siblings, 1 reply; 3+ messages in thread
From: Alan Cox @ 2006-08-16 16:36 UTC (permalink / raw)
  To: akpm, linux-kernel

Signed-off-by: Alan Cox <alan@redhat.com>

diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla-2.6.18-rc4-mm1/kernel/acct.c linux-2.6.18-rc4-mm1/kernel/acct.c
--- linux.vanilla-2.6.18-rc4-mm1/kernel/acct.c	2006-08-15 15:40:19.000000000 +0100
+++ linux-2.6.18-rc4-mm1/kernel/acct.c	2006-08-15 16:03:18.000000000 +0100
@@ -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(&current->sighand->siglock);
 	ac.ac_utime = encode_comp_t(jiffies_to_AHZ(cputime_to_jiffies(pacct->ac_utime)));


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: PATCH: Lock tty directly in acct layer
  2006-08-16 16:24 ` Arjan van de Ven
@ 2006-08-16 17:09   ` Alan Cox
  0 siblings, 0 replies; 3+ messages in thread
From: Alan Cox @ 2006-08-16 17:09 UTC (permalink / raw)
  To: Arjan van de Ven; +Cc: akpm, linux-kernel

Ar Mer, 2006-08-16 am 18:24 +0200, ysgrifennodd Arjan van de Ven:
> > -	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 ?

I'm not sure, thats a good question (as if so is how to lock it). Will
investigate.


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2006-08-16 16:49 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-08-16 16:36 PATCH: Lock tty directly in acct layer Alan Cox
2006-08-16 16:24 ` Arjan van de Ven
2006-08-16 17:09   ` Alan Cox

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®