lkml.org 
[lkml]   [2009]   [Aug]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: xterm loses data (pty regression)


On Mon, 10 Aug 2009, Linus Torvalds wrote:
>
> On Mon, 10 Aug 2009, Ray Lee wrote:
> > On Mon, Aug 10, 2009 at 8:29 AM, Artur Skawina <art.08.09@gmail.com> wrote:
> > >
> > > First noticed it after upgrading to v2.6.31-rc5-246-g90bc1a6, still happens
> > > in rc5-381-g7b2aa03.
> > > If i press ^S in an xterm the output stops as expected, but after a ^Q i see
> > > only the newly written data, everything in between is lost.
>
> Yup, I can confirm that.
>
> > > > for i in `seq 1 111`; do echo $i; sleep 1; done
>
> (Do ^S/^Q, see data loss)
>
> Will take a look asap, thanks. Although I bet it's the same old commit
> (d945cb9cc: "pty: Rework the pty layer to use the normal buffering logic")
> again.

I think it's really this trivial.

That pty commit removed the checking for tty->stopped in
pty_write_buffer() for no clear reason. And when it did that, it broke all
the pausing logic in drivers/char/n_tty.c.

Can you confirm?

Linus

---
drivers/char/pty.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/drivers/char/pty.c b/drivers/char/pty.c
index 6e6942c..d083c73 100644
--- a/drivers/char/pty.c
+++ b/drivers/char/pty.c
@@ -144,6 +144,8 @@ static int pty_write(struct tty_struct *tty, const unsigned char *buf,

static int pty_write_room(struct tty_struct *tty)
{
+ if (tty->stopped)
+ return 0;
return pty_space(tty->link);
}


\
 
 \ /
  Last update: 2009-10-18 23:28    [W:0.082 / U:0.020 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site