Re: How to lock current->signal->tty

Luck, Tony
2006-08-08T16:41:39Z

On Tue, Aug 08, 2006 at 04:44:36PM +0100, Alan Cox wrote:
> Ar Maw, 2006-08-08 am 08:10 -0700, ysgrifennodd Arjan van de Ven:
> > > Unfortunately:
> > > Dquot passes the tty to tty_write_message without locking
> > > arch/ia64/kernel/unanligned seems to write to it without locking
> >
> > these two have absolutely no business at all using anything tty.... they should
> > just use printk with KERN_EMERG or whatever
>
> Dquot does - it writes to the controlling tty of the process exceeding
> quota . That is standard Unix behaviour

IA-64 is also trying to be helpful by putting the message where
the user may actually see it (following the dquot precedent). But
the whole subject of whether we should print any messages for
unaligned accesses at all is rather controversial. So its a 50-50
shot whether I'll fix it by adding the mutex_lock/mutex_unlock
around the use of current->signal->tty, or just rip this out and
just leave the printk().

-Tony