lkml.org 
[lkml]   [2008]   [Aug]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] vt: kill tty->count usage (v2)
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



\
 
 \ /
  Last update: 2008-08-19 19:07    [W:0.062 / U:10.184 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site