On Sul, 2005-01-23 at 18:22, Linus Torvalds wrote:
> I think it's only the tty_ldisc_ref_wait() thing that can deadlock (and 
> even that is likely safe if you just specify an order - "masters first" or 
> something). Adding a nonblocking "tty_ldisc_ref()" looks safe, ie 
> something like the appended.

Yes.

> This has the problem (apart from the fact that it's obviously totally
> untested ;) that it looks like every single pty function would need to do
> it, so it would be nicer if "tty_ldisc_ref_wait()" would just always get
> both references (ie do the ordering). Alan?

Almost every user of tty_ldisc_ref_* doesn't need to lock two objects
and
the code at that layer has no knowledge of pty/tty pairs. The needed
info is exposed however in order to do this since the tty knows if its a
tty/pty pair. I'll take a look - chances are it can be buried in
tty_ldisc_ref.

I'm dubious this is the actual bug although vhangup on a pty might
trigger it I guess.

Alan

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Reply via email to