lkml.org 
[lkml]   [2012]   [Jul]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] n_tty: Don't lose characters when PARMRK is enabled
On Thu, 26 Jul 2012 17:12:31 -0500
Jaeden Amero <jaeden.amero@ni.com> wrote:

> When PARMRK is set and large transfers of characters that will get
> marked are being received, n_tty could drop data silently (i.e.
> without reporting any error to the client). This is because
> characters have the potential to take up to three bytes in the line
> discipline (when they get marked with parity or framing errors), but
> the amount of free space reported to tty_buffer flush_to_ldisc (via
> tty->receive_room) is based on the pre-marked data size.
>
> With this patch, the n_tty layer will no longer assume that each byte
> will only take up one byte in the line discipline. Instead, it will
> make an overly conservative estimate that each byte will take up
> three bytes in the line discipline when PARMRK is set.
>
> Signed-off-by: Jaeden Amero <jaeden.amero@ni.com>

What a fun corner case. Patch looks good to me.

Acked-by: Alan Cox <alan@linux.intel.com>


\
 
 \ /
  Last update: 2012-07-27 15:41    [W:0.048 / U:2.344 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site