History

pty: fix data loss when stopped (^S/^Q)

Commit d945cb9cc ("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.

Linus Torvalds committed 17 years ago

Commit 85dfd811 parent d00aa661 file · +2 −0Browse files

Unified · Split

drivers/char/pty.c+2−0
@@ -144,6 +144,8 @@ static int pty_write(struct tty_struct *tty, const unsigned char *buf, · 143 unmodified lines
144 144
145static int pty_write_room(struct tty_struct *tty)145static int pty_write_room(struct tty_struct *tty)
146{146{
147 if (tty->stopped)
148 return 0;
147 return pty_space(tty->link);149 return pty_space(tty->link);
148}150}
149 151