Commit 5a44eca1 authored by Cyrill Gorcunov's avatar Cyrill Gorcunov Committed by Pavel Emelyanov

tty: Don't forget to unblock tty peers

When testing for queued data present on
peers we setup non-blocking mode over them
to obtain -EAGAIN if there is no data
at all, but I forget to restore former
mode on return, ie blocking read.
Reported-by: 's avatarAndrey Vagin <avagin@virtuozzo.com>
Signed-off-by: 's avatarCyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: 's avatarPavel Emelyanov <xemul@virtuozzo.com>
parent c9a22844
...@@ -1917,18 +1917,18 @@ static int tty_do_dump_queued_data(struct tty_dump_info *dinfo) ...@@ -1917,18 +1917,18 @@ static int tty_do_dump_queued_data(struct tty_dump_info *dinfo)
*/ */
static void __tty_do_writeback_queued_data(struct tty_dump_info *dinfo) static void __tty_do_writeback_queued_data(struct tty_dump_info *dinfo)
{ {
if (write(dinfo->link->lfd, dinfo->tty_data, if (dinfo->tty_data) {
dinfo->tty_data_size) != dinfo->tty_data_size) if (write(dinfo->link->lfd, dinfo->tty_data,
pr_perror("Can't writeback to tty (%#x)\n", dinfo->id); dinfo->tty_data_size) != dinfo->tty_data_size)
pr_perror("Can't writeback to tty (%#x)\n", dinfo->id);
}
tty_reblock(dinfo->link->id, dinfo->link->lfd, dinfo->link->flags); tty_reblock(dinfo->link->id, dinfo->link->lfd, dinfo->link->flags);
} }
static void tty_do_writeback_queued_data(struct tty_dump_info *dinfo) static void tty_do_writeback_queued_data(struct tty_dump_info *dinfo)
{ {
if (dinfo->tty_data) __tty_do_writeback_queued_data(dinfo);
__tty_do_writeback_queued_data(dinfo); __tty_do_writeback_queued_data(dinfo->link);
if (dinfo->link->tty_data)
__tty_do_writeback_queued_data(dinfo->link);
} }
static void tty_dinfo_free(struct tty_dump_info *dinfo) static void tty_dinfo_free(struct tty_dump_info *dinfo)
......
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