Commit b4a1a4cc authored by Peter Hurley's avatar Peter Hurley Committed by Greg Kroah-Hartman

n_tty: Ensure reader restarts worker for next reader

commit 42458f41 upstream.

A departing reader must restart a flush_to_ldisc() worker _before_
the next reader enters the read loop; this is to avoid the new reader
concluding no more i/o is available and prematurely exiting, when the
old reader simply hasn't re-started the worker yet.
Signed-off-by: default avatarPeter Hurley <peter@hurleysoftware.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent a4839c4c
......@@ -2253,6 +2253,9 @@ static ssize_t n_tty_read(struct tty_struct *tty, struct file *file,
if (time)
timeout = time;
}
n_tty_set_room(tty);
up_read(&tty->termios_rwsem);
mutex_unlock(&ldata->atomic_read_lock);
remove_wait_queue(&tty->read_wait, &wait);
......@@ -2263,8 +2266,6 @@ static ssize_t n_tty_read(struct tty_struct *tty, struct file *file,
if (b - buf)
retval = b - buf;
n_tty_set_room(tty);
up_read(&tty->termios_rwsem);
return retval;
}
......
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