2005-01-24 06:55:36

by Andris Pavenis

[permalink] [raw]
Subject: [PATCH] [Bug 3736] Bug in tty_io.c after changes between 2.6.9-rc1-bk1 and 2.6.9-rc1-bk2

Tried to fix a bug
http://bugzilla.kernel.org/show_bug.cgi?id=3736
which appeared between kernels 2.6.9-rc1-bk1 and 2.6.9-rc1-bk2.

Suceeded to localize it to part of changes in drivers/char/tty_io.c.
I guess changes were according changelog:

-----------------------------------
[email protected], 2004-08-24 12:29:18-07:00,
[email protected]
[PATCH] /dev/ptmx open() fixes

If tty_open() fails for a normal serial device, we end up doing cleanups
that should only happen for failed open of /dev/ptmx. The results are
not pretty - devpts et.al. end up very confused. That's what gave
problems with ptmx.

This splits ptmx file_operations from the normal case and cleans up both
tty_open() and (new) ptmx_open(). Survived serious beating.
-----------------------------------

Finally located that a problem seems to be a simple typo (

--- linux-2.6.10/drivers/char/tty_io.c~1 2004-12-24 23:34:58.000000000 +0200
+++ linux-2.6.10/drivers/char/tty_io.c 2005-01-22 10:54:32.000000000 +0200
@@ -1148,7 +1148,7 @@ static inline void pty_line_name(struct
int i = index + driver->name_base;
/* ->name is initialized to "ttyp", but "tty" is expected */
sprintf(p, "%s%c%x",
- driver->subtype == PTY_TYPE_SLAVE ? "tty" : driver->name,
+ driver->subtype == PTY_TYPE_SLAVE ? "pty" : driver->name,
ptychar[i >> 4 & 0xf], i & 0xf);
}

At least as I tested, it fixes the problem on one of systems on which I
tested.

Andris