[lkml]   [2013]   [Feb]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [PATCH v3 03/23] n_tty: Don't flush buffer when closing ldisc
On 02/05/2013 09:20 PM, Peter Hurley wrote:
> A buffer flush is both undesirable and unnecessary when the ldisc
> is closing. A buffer flush performs the following:
> 1. resets ldisc data fields to their initial state
> 2. resets tty->receive_room to indicate more data can be sent
> 3. schedules buffer work to receive more data
> 4. signals a buffer flush has happened to linked pty in packet mode
> Since the ldisc has been halted and the tty may soon be destructed,
> buffer work must not be scheduled as that work might access
> an invalid tty and ldisc state. Also, the ldisc read buffer is about
> to be freed, so that's pointless.
> Resetting the ldisc data fields is pointless as well since that
> structure is about to be freed.
> Resetting tty->receive_room is unnecessary, as it will be properly
> reset if a new ldisc is reopened. Besides, resetting the original
> receive_room value would be wrong since the read buffer will be
> gone.
> Since the packet mode flush is observable from userspace, this
> behavior has been preserved.

This one looks good to me.

suse labs

 \ /
  Last update: 2013-02-07 16:44    [W:0.711 / U:1.372 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site