public inbox for linux-arch@vger.kernel.org
 help / color / mirror / Atom feed
From: Alan Cox <alan@lxorguk.ukuu.org.uk>
To: richard -rw- weinberger <richard.weinberger@gmail.com>
Cc: Kay Sievers <kay.sievers@vrfy.org>, Greg KH <gregkh@suse.de>,
	stian@nixia.no, LKML <linux-kernel@vger.kernel.org>,
	Linux-Arch <linux-arch@vger.kernel.org>,
	user-mode-linux-devel@lists.sourceforge.net
Subject: Re: [uml-devel] /sys/class/tty/tty0/active?
Date: Fri, 27 Jan 2012 11:51:43 +0000	[thread overview]
Message-ID: <20120127115143.1943336b@pyramind.ukuu.org.uk> (raw)
In-Reply-To: <CAFLxGvzth1m=iUmXbU2WyGrw0i8441d2nKLjH=mY_f1O-hkKPQ@mail.gmail.com>

> UML's console driver (arch/um/drivers/line.c) implements tty_operations.
> The crash happens because the tty subsystem calls the driver's close()
> function and later
> write_room() or chars_in_buffer().
> 
> write_room() and chars_in_buffer() fail badly because close() already
> cleaned up the driver's private data...

You don't want to do that.

> Greg, is UML's assumption wrong that after closing the tty no call to
> write_room() or chars_in_buffer() can happen?
> I have no idea why systemd is able to trigger this, UML's console
> driver is old and has always worked quite well.

It's always been untrue but it's even more untrue nowdays. The tty layer
objects are refcounted, and the code has had significant rewrites. line.c
hidden away in uml hasn't been updated.

I added a comment about 3 years ago pointing out another older change
that was needed and that wasn't acted on either..

Take a look at how all the other tty drivers use tty_port, how the ioctls
have been supposed to work for the past few years and the callback
changes, then use them.

tty_port will actually do most of the hard work for you.

Alan

  reply	other threads:[~2012-01-27 11:50 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-26 21:52 /sys/class/tty/tty0/active? richard -rw- weinberger
2012-01-26 21:52 ` /sys/class/tty/tty0/active? richard -rw- weinberger
2012-01-26 22:11 ` [uml-devel] /sys/class/tty/tty0/active? stian
2012-01-26 22:12   ` richard -rw- weinberger
2012-01-26 22:56     ` richard -rw- weinberger
2012-01-27  1:08       ` Greg KH
2012-01-27  1:30         ` Kay Sievers
2012-01-27  1:30           ` Kay Sievers
2012-01-27  9:20           ` richard -rw- weinberger
2012-01-27 11:51             ` Alan Cox [this message]
2012-01-27 12:04               ` richard -rw- weinberger
2012-01-27 14:02                 ` Alan Cox
2012-01-27 23:55                   ` richard -rw- weinberger
2012-01-28 14:11                     ` /sys/class/tty/tty0/active? richard -rw- weinberger
2012-01-28 14:11                       ` [uml-devel] /sys/class/tty/tty0/active? richard -rw- weinberger

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=20120127115143.1943336b@pyramind.ukuu.org.uk \
    --to=alan@lxorguk.ukuu.org.uk \
    --cc=gregkh@suse.de \
    --cc=kay.sievers@vrfy.org \
    --cc=linux-arch@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=richard.weinberger@gmail.com \
    --cc=stian@nixia.no \
    --cc=user-mode-linux-devel@lists.sourceforge.net \
    /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