]> git.baikalelectronics.ru Git - kernel.git/commit
pty: fix data loss when stopped (^S/^Q)
authorLinus Torvalds <torvalds@linux-foundation.org>
Mon, 10 Aug 2009 20:21:19 +0000 (13:21 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Mon, 10 Aug 2009 20:31:18 +0000 (13:31 -0700)
commit47e19315241d5936678419133d92b5941d723431
tree7b09e7d8fdc4dbe7e57a3fc2df659a5506dfaa77
parente8f15a58a8d3ecdee67b9c3107974b795aeecf49
pty: fix data loss when stopped (^S/^Q)

Commit b58eab12c ("pty: Rework the pty layer to use the normal buffering
logic") dropped the test for 'tty->stopped' in pty_write_room(), which
then causes the n_tty line discipline thing to not throttle the data
properly when the tty is stopped.

So instead of pausing the write due to the tty being stopped, the ldisc
layer would go ahead and push it down to the pty.  The pty write()
routine would then refuse to take the data (because it _did_ check
'stopped'), and the data wouldn't actually be written.

This whole stopped test should eventually be moved into the tty ldisc
layer rather than have low-level tty drivers care about these things,
but right now the fix is to just re-instate the missing pty 'stopped'
handling.

Reported-and-tested-by: Artur Skawina <art.08.09@gmail.com>
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
drivers/char/pty.c