On Wed, 14 Oct 2009, Alan Cox wrote: > > The better existing lock is probably tty->ldisc_mutex which we take when > doing ldisc changes (which are an even more dramatic change during > receive_buf). Yeah, that makes sense. And then we'd automatically also solve the "somebody tries to write during ldisc changes" issue. Not that I've checked how much it could help, but maybe we could get rid of _some_ of the special "tty_get_ldisc_wait()" kind of hacks. And having that then protect flushing too would get rid of the TTY_FLUSHING and TTY_FLUSHPENDING logic. So it does smell like a good solution (without me looking at the code any closer right now, I can't take any more tty code reading just now ;) Linus -- To unsubscribe from this list: send the line "unsubscribe kernel-testers" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html