Commit 91297b59 authored by Linus Torvalds's avatar Linus Torvalds

Limit tty IO chunking to 2kB

The NTTY code can get confused by 4kB chunks, apparently
because n_tty_receive_room() will claim to have more room
than n_tty_receive_buf() can actually accept.

Until somebody figures out what the real n_tty_receive_room()
logic should be, let's just limit it to a safe 2kB.

Thanks go to Andreas Schwab for finding a test-case.
parent 547b39b5
......@@ -1047,8 +1047,13 @@ static inline ssize_t do_tty_write(
*
* But if TTY_NO_WRITE_SPLIT is set, we should use a
* big chunk-size..
*
* The default chunk-size is 2kB, because the NTTY
* layer has problems with bigger chunks. It will
* claim to be able to handle more characters than
* it actually does.
*/
chunk = 4096;
chunk = 2048;
if (test_bit(TTY_NO_WRITE_SPLIT, &tty->flags))
chunk = 65536;
if (count < chunk)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment