lkml.org 
[lkml]   [1998]   [Aug]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: [2.1.113] What is CHECK_TTY_COUNT warning me about?
We really should mount a concerted effort to find and fix this bug -- it's been
around for a long time, and harmful or not I'd like to at least find what's
causing it.

I've attached a small diagnostic patch to start gathering more info about what's
going on, and would like to ask anyone who occasionally triggers this bug to
apply the patch and report the results back to the kernel list. Hopefully we'll
have this fixed very soon.

Regards,
Bill


--- linux-2.1.115/drivers/char/tty_io.c.old Thu Aug 6 16:54:08 1998
+++ linux-2.1.115/drivers/char/tty_io.c Thu Aug 6 18:09:00 1998
@@ -184,14 +184,32 @@
if(f->private_data == tty)
count++;
}
+ /*
+ * Check whether a PTY master holds an additional count.
+ */
if (tty->driver.type == TTY_DRIVER_TYPE_PTY &&
tty->driver.subtype == PTY_TYPE_SLAVE &&
tty->link && tty->link->count)
count++;
+
if (tty->count != count) {
printk("Warning: dev (%s) tty->count(%d) != #fd's(%d) in %s\n",
kdevname(tty->device), tty->count, count, routine);
- return count;
+
+ printk("task=%s, type=%d, subtype=%d\n",
+ current->comm, tty->driver.type, tty->driver.subtype);
+ /*
+ * Show which files were in use
+ */
+ for(f = inuse_filps; f && f->private_data == tty; f = f->f_next)
+ printk("found f_count=%d, f_dentry=%p, f_op=%p\n",
+ f->f_count, f->f_dentry, f->f_op);
+
+ if (tty->driver.type == TTY_DRIVER_TYPE_PTY &&
+ tty->driver.subtype == PTY_TYPE_SLAVE &&
+ tty->link && tty->link->count)
+ printk("pty master holds count\n");
+ return 1;
}
#endif
return 0;
\
 
 \ /
  Last update: 2005-03-22 13:43    [W:0.420 / U:0.160 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site