linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Aristeu Rozanski <aris@redhat.com>
To: Alan Cox <alan@lxorguk.ukuu.org.uk>
Cc: linux-kernel@vger.kernel.org, akpm@linux-foundation.org,
	jirislaby@gmail.com
Subject: Re: [PATCH] vt: kill tty->count usage (v2)
Date: Tue, 19 Aug 2008 13:03:17 -0400	[thread overview]
Message-ID: <20080819170317.GC7154@redhat.com> (raw)
In-Reply-To: <20080819160318.26f70590@lxorguk.ukuu.org.uk>

Hi Alan,
> > > > The commit e0426e6a09954d205da2d674a3d368d2715e3afd fixes a real race but
> > > > still isn't enough to prevent these:
> > > > 
> > > > kobject_add_internal failed for vcs7 with -EEXIST, don't try to register
> > > > things with the same name in the same direc.
> > > 
> > > Patch dropped due to testing failures.
> > > 
> > > Boot to run level 3, log in and type "reboot\n". Wait
> > > 
> > > Spews vt->driver_data == NULL warnings and oopses
> > do you mind posting the logs somewhere? I wasn't able to reproduce it here so
> 
> I decided it might be better to tackle this one 'head on' and go to the
> root of the problem. I've pushed the following into the stack of patches
> for -next
> 
> tty: shutdown method
I agree with the idea, but:

>  /**
>   *	release_one_tty		-	release tty structure memory
>   *	@kref: kref of tty we are obliterating
> @@ -1489,27 +1514,11 @@ static void release_one_tty(struct kref *kref)
>  {
>  	struct tty_struct *tty = container_of(kref, struct tty_struct, kref);
>  	struct tty_driver *driver = tty->driver;
> -	int devpts = tty->driver->flags & TTY_DRIVER_DEVPTS_MEM;
> -	struct ktermios *tp;
> -	int idx = tty->index;
> -
> -	if (!devpts)
> -		tty->driver->ttys[idx] = NULL;
> -
> -	if (tty->driver->flags & TTY_DRIVER_RESET_TERMIOS) {
> -		/* FIXME: Locking on ->termios array */
> -		tp = tty->termios;
> -		if (!devpts)
> -			tty->driver->termios[idx] = NULL;
> -		kfree(tp);
> -
> -		tp = tty->termios_locked;
> -		if (!devpts)
> -			tty->driver->termios_locked[idx] = NULL;
> -		kfree(tp);
> -	}
> -
>  
> +	if (tty->ops->shutdown)
> +		tty->ops->shutdown(tty);
> +	else
> +		tty_shutdown(tty);
>  	tty->magic = 0;
>  	/* FIXME: locking on tty->driver->refcount */
>  	tty->driver->refcount--;
isn't too late for drivers that wait for the remaining data to be transmitted
such as amiserial and cyclades? Unless there's a plan to do it at
release_dev()?

-- 
Aristeu


  reply	other threads:[~2008-08-19 17:04 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-08-08 21:36 [PATCH] vt: kill tty->count usage Aristeu Rozanski
2008-08-08 21:26 ` Alan Cox
2008-08-12 14:58   ` [PATCH] vt: kill tty->count usage (v2) Aristeu Rozanski
2008-08-15  9:58     ` Alan Cox
2008-08-18 17:19     ` Alan Cox
2008-08-18 21:04       ` Aristeu Rozanski
2008-08-18 21:01         ` Alan Cox
2008-08-19 12:37         ` Alan Cox
2008-08-19 15:03         ` Alan Cox
2008-08-19 17:03           ` Aristeu Rozanski [this message]
2008-08-19 17:14             ` Alan Cox
2008-08-20  0:03               ` Aristeu Rozanski

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=20080819170317.GC7154@redhat.com \
    --to=aris@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=jirislaby@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).