[LTP] [PATCH v4 1/2] pty04: Use guarded buffers for transmission

Petr Vorel pvorel@suse.cz
Tue May 5 17:01:55 CEST 2020


Hi Richard,

> This looks similar to the issue reported by Jan:

> https://github.com/linux-test-project/ltp/issues/674

> Is this the full output?
Yes, it's exactly the same issue. Thanks for info, I overlooked this bug.

> Thinking aloud: the following (probably) happens when writing to the PTY

> write() -> PTY -> SLIP/SLCAN -> netdev -> read()

> Writing to the PTY causes the PTY to write to the line discipline. What
> I found was that when the line discipline receive buffer got full and the PTY
> send buffer got full. The write would go to sleep and never wake up
> because the line discipline drained the receive buffer, but doesn't
> signal it is ready for more data (with tty_unthrottle). So I used
> nonblocking writes which just retry writing.

> From Jan's errors it looks like it might just be reading that is failing
> in one case and that writing is also failing in the other until we
> cancel the read. I doubt this is anything to do with the netdev code
> because it is generic networking code AFAICT and should work correctly
> with blocking reads...
Hm, I'm not familiar with the code, but also thing it's not netdev related.

Kind regards,
Petr


More information about the ltp mailing list