Re: [PATCH] 2.5.68-bk1 crash in devfs_remove() for defpts files

Christoph Hellwig
2003-04-21T20:45:09Z

On Mon, Apr 21, 2003 at 04:35:21PM -0400, Pavel Roskin wrote:
> > Oh, I see now. There's a longstanding bug in the handling of
> > TTY_DRIVER_NO_DEVFS that got exposed by this.
> >
> > Please try this patch additionally:
>
> Applied. Now I can log in by ssh and there are no problems with
> pseudoterminals. However, all local terminals are gone:

The devfs <-> tty interaction are going to drive me nuts.

TTY_DRIVER_NO_DEVFS actually means don't call tty_register_device
in tty_register_driver, not don't register with devfs.

Updated patch (replaces the last one):

--- 1.78/drivers/char/tty_io.c Sat Apr 19 19:24:04 2003
+++ edited/drivers/char/tty_io.c Mon Apr 21 21:28:01 2003
@@ -2173,9 +2173,9 @@

list_add(&driver->tty_drivers, &tty_drivers);

- if ( !(driver->flags & TTY_DRIVER_NO_DEVFS) ) {
- for(i = 0; i < driver->num; i++)
- tty_register_device(driver, driver->minor_start + i);
+ if (!(driver->flags & TTY_DRIVER_NO_DEVFS)) {
+ for (i = 0; i < driver->num; i++)
+ tty_register_device(driver, driver->minor_start + i);
}
proc_tty_register_driver(driver);
return error;
@@ -2215,7 +2215,8 @@
driver->termios_locked[i] = NULL;
kfree(tp);
}
- tty_unregister_device(driver, driver->minor_start + i);
+ if (!(driver->flags & TTY_DRIVER_NO_DEVFS))
+ tty_unregister_device(driver, driver->minor_start + i);
}
proc_tty_unregister_driver(driver);
return 0;