public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Alan Cox <alan@lxorguk.ukuu.org.uk>
To: Ryan Arnold <rsa@us.ibm.com>
Cc: "Theodore Ts'o" <tytso@mit.edu>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: ldisc writes during tty release_dev() causing problems.
Date: Fri, 24 Sep 2004 16:30:04 +0100	[thread overview]
Message-ID: <1096039802.10145.4.camel@localhost.localdomain> (raw)
In-Reply-To: <1096042734.3355.51.camel@localhost.localdomain>

On Gwe, 2004-09-24 at 17:18, Ryan Arnold wrote:
> I think I see what you mean.  The ldisc write_chan code is actually
> invoked from the terminal process and if this is I/O blocked then the
> terminal process cannot invoke release_dev().  So why did I experience
> calls to hvc_write() after the final open instance was closed with
> release_dev()?

At the moment if the user types a character and the line discipline
echoes it then you can get a write call to the driver. N_TTY tends to do
this one. When we close the ldisc first this should go away, but we
aren't quite there yet.

> > I had assumed would have to come from the serial side because if the
> > last owner is executing close() they can't be executing vhangup on the
> > same but given a rapid close/re-open/vhangup on a new fd it might be
> > a dangerous assumption. Added to the TODO pile
> 
> In hvc_console we don't have a serial side, but I do have the device
> side which will invoke a tty_hangup() if an hvc adapter was hotplug
> removed.  This doesn't happen for the actual console adapter (hvc0)
> because it isn't allowed in firmware.

Ok so this probably is a close v open->hangup race. In which case it
shouldn't be too hard to fix now the first locking work is done. Until
then the change you suggest makes sense. I'll investigate that race in
more detail however because close() v open() and close cancelling the
workqueue for hangup ought to be stopping it.


      reply	other threads:[~2004-09-24 16:54 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-09-15 18:43 [PATCH] hvc_console fix to protect hvc_write against ldisc write after hvc_close Ryan Arnold
2004-09-15 19:20 ` Alan Cox
2004-09-15 21:23   ` Ryan Arnold
2004-09-15 20:41 ` Theodore Ts'o
2004-09-15 21:36   ` Alan Cox
2004-09-15 22:35   ` Ryan Arnold
2004-09-24  1:15   ` ldisc writes during tty release_dev() causing problems Ryan Arnold
2004-09-24 12:40     ` Alan Cox
2004-09-24 16:18       ` Ryan Arnold
2004-09-24 15:30         ` Alan Cox [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1096039802.10145.4.camel@localhost.localdomain \
    --to=alan@lxorguk.ukuu.org.uk \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rsa@us.ibm.com \
    --cc=tytso@mit.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox