Re: Another devfs bug (NOT)

Richard Gooch (rgooch@atnf.csiro.au)
Mon, 12 Oct 1998 11:11:44 +1000


slava_pestov@geocities.com writes:
> I am running a monolithic kernel 2.1.125+devfs v69. Unix98 PTY support
> is
> NOT compiled into the kernel, but /dev/ptmx appears anyway. An attempt
> to
> echo hi >/dev/ptmx gives me:
>
> Oct 11 15:09:12 fireball kernel: Unable to handle kernel NULL pointer
[...]
> EIP: init_dev
> Call trace: devfs_follow_link tty_open open_namei open_namei devfs_open
> do_open sys_open system_call

This is in fact not a devfs problem. Boot a virgin 2.1.125 kernel and
cat /dev/ptmx will also generate an Oops. So there is some bug in the
standard tty code.

Please, when you see a bug with a devfs kernel, please first build a
non-devfs kernel and test that before reporting a bug.

Also, if you do find a devfs bug, please report it directly to me
rather than to the list. This keeps the list traffic down and also
gets the bug report into my mailbox sooner (vger sometimes takes a
long time to clear).

> This patch fixes the problem:
[snipped bits of it]
> @@ -2267,6 +2270,7 @@
> con_init_devfs();
> #endif
>
> +#ifdef CONFIG_UNIX98_PTYS
> dev_ptmx_driver = dev_tty_driver;
> dev_ptmx_driver.driver_name = "/dev/ptmx";
> dev_ptmx_driver.name = dev_ptmx_driver.driver_name + 5;
> @@ -2277,6 +2281,7 @@
>
> if (tty_register_driver(&dev_ptmx_driver))
> panic("Couldn't register /dev/ptmx driver\n");
> +#endif

This might be one way of fixing it. It seems to me, though, that the
bug is really in tty_open(), so perhaps that should be fixed.
Ted: what is your view on this?

Regards,

Richard....

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/