[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <5113C0D8.60107@suse.cz>
Date: Thu, 07 Feb 2013 15:57:28 +0100
From: Jiri Slaby <jslaby@...e.cz>
To: Peter Hurley <peter@...leysoftware.com>
CC: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Alan Cox <alan@...ux.intel.com>,
Sasha Levin <levinsasha928@...il.com>,
Sebastian Andrzej Siewior <bigeasy@...utronix.de>,
linux-serial@...r.kernel.org, linux-kernel@...r.kernel.org,
Ilya Zykov <ilya@...x.ru>, Dave Jones <davej@...hat.com>
Subject: Re: [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.
--
js
suse labs
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists