Re: [PATCH] tty: Fix async io write notifications

From: Alan Cox
Date: Mon Nov 24 2008 - 09:22:02 EST


On Mon, 24 Nov 2008 14:40:15 +0100 (CET)
Thomas Pfaff <tpfaff@xxxxxxx> wrote:

> he N_TTY ldisc layer does not send SIGIO POLL_OUTs correctly when output is
> possible due to flawed handling of the TTY_DO_WRITE_WAKEUP bit. It will either
> send no SIGIOs at all or on every tty wakeup.
>
> The fix is to set the bit when the tty driver write would block and test and
> clear it on write wakeup.
>
> Signed-off-by: Thomas Pfaff <tpfaff@xxxxxxx>

I had done a patch already but yours is somewhat nicer so I've merged
yours instead with some tweaks as it clashed with an existing N_TTY patch

I left the tty->fasync check in the if (in case the user clears async I/O
events) and I reversed the tests on the end of n_tty_write simply
because the compiler has the variables we need to check to hand but not
tty->fasync.

This all looks good to me. It breaks on ptys but that is another bug and
I'll merge a patch to fix the ptys next.

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