Re: proper tty-ldisc refcounting (was Re: WARNING at:drivers/char/tty_ldisc.c)

From: Greg KH
Date: Tue Aug 04 2009 - 11:09:11 EST


On Tue, Aug 04, 2009 at 12:12:37PM +0300, Sergey Senozhatsky wrote:
> On (08/04/09 00:23), Greg KH wrote:
> > On Mon, Aug 03, 2009 at 11:19:53PM -0700, Linus Torvalds wrote:
> > >
> > >
> > > On Mon, 3 Aug 2009, Greg KH wrote:
> > > >
> > > > Oh wait, the original problem, single user mode. Hm, we need all of
> > > > these to fix that problem? Or just the first one?
> > >
> > > Patches 1-3 should fix that one. 4-5 are just cleanups with no semantic
> > > changes.
> >
> > Ok, but due to the lateness of the release cycle, is it worth it to add
> > those 3 right now? Or do we just take the BUG_ON() out as it's pretty
> > harmless while shutting down in single user mode?
> >
> > What do you think?
> >
>
> I don't think that take the BUG_ON out is the best we can do.
>
> If I understand correctly, this one (tty_ldisc.c:209):
> static void tty_ldisc_put(struct tty_ldisc *ld)
> {
> [...]
> spin_unlock_irqrestore(&tty_ldisc_lock, flags);
> - WARN_ON(ld->refcount);
> kfree(ld);
> }
>
> It's better to leave everything as is in that case and wait 32 (to my mind).

Sorry, you are correct, it was a WARN_ON call that caused the warning.

One other option is to put these changes into .32, and add them back to
the .31 -stable tree once it goes into Linus's tree and no one has any
reported problems.

thanks,

greg k-h
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/