The patch titled do_tty_write() can block even with O_NONBLOCK? has been removed from the -mm tree. Its filename was do_tty_write-can-block-even-with-o_nonblock.patch This patch was dropped because it was nacked by the maintainer ------------------------------------------------------ Subject: do_tty_write() can block even with O_NONBLOCK? From: Dave Johnson <djohnson+linux-kernel@xxxxxxxxxxxxxxxxxxxxxx> I have two processes with the same tty open, one opens blocking and one opens nonblocking. If the blocking process blocks doing a write (due to flow control, just going to fast, etc...) the nonblocking process will also block when it writes until the blocking process unblocks. This seems to occur because do_tty_write() isn't checking for O_NONBLOCK when taking the tty's write mutex. Signed-off-by: Dave Johnson <djohnson+linux-kernel@xxxxxxxxxxxxxxxxxxxxxx> Acked-by: Alan Cox <alan@xxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- drivers/char/tty_io.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff -puN drivers/char/tty_io.c~do_tty_write-can-block-even-with-o_nonblock drivers/char/tty_io.c --- a/drivers/char/tty_io.c~do_tty_write-can-block-even-with-o_nonblock +++ a/drivers/char/tty_io.c @@ -1699,9 +1699,12 @@ static inline ssize_t do_tty_write( ssize_t ret = 0, written = 0; unsigned int chunk; - /* FIXME: O_NDELAY ... */ - if (mutex_lock_interruptible(&tty->atomic_write_lock)) { - return -ERESTARTSYS; + if (file->f_flags & O_NONBLOCK) { + if (!mutex_trylock(&tty->atomic_write_lock)) + return -EAGAIN; + } else { + if (mutex_lock_interruptible(&tty->atomic_write_lock)) + return -ERESTARTSYS; } /* _ Patches currently in -mm which might be from djohnson+linux-kernel@xxxxxxxxxxxxxxxxxxxxxx are do_tty_write-can-block-even-with-o_nonblock.patch - To unsubscribe from this list: send the line "unsubscribe mm-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html