Re: [PATCH 1/1] Char: tty_io, fix closecount counting

From: Jiri Slaby
Date: Sat May 31 2008 - 07:50:10 EST


Jiri Slaby napsal(a):
This is probably a fix for an issue first reported in 2.6.18.1:
http://lkml.org/lkml/2006/10/20/301
and
http://marc.info/?l=linux-mips&m=118797256328587

Alan, I know, you already stated some time ago, that you don't have a clue what could have caused this. Haven't you found anything since that time as I think the hangup path is the only possible cause of this problem?

I've found an other one from 2.6.17-rc4:
http://readlist.com/lists/vger.kernel.org/linux-kernel/44/220050.html
and from 2.6.22+suse_stuff:
http://lists.opensuse.org/opensuse-bugs/2008-04/msg05628.html

It is ever vcs1, which is /dev/console and it is the only treated separately (otherwise I think we would have more (and distinct) reports like this). When the console is HUPped? And what should happen with openers? The 2.6.22+suse happened when sulogin /dev/console was invoked. Any ideas how to track this down?

--- a/drivers/char/tty_io.c
+++ b/drivers/char/tty_io.c
@@ -1434,9 +1434,9 @@ static void do_tty_hangup(struct work_struct *work)
list_for_each_entry(filp, &tty->tty_files, f_u.fu_list) {
if (filp->f_op->write == redirected_tty_write)
cons_filp = filp;
+ closecount++;
if (filp->f_op->write != tty_write)
continue;
- closecount++;
tty_fasync(-1, filp, 0); /* can't block */
filp->f_op = &hung_up_tty_fops;
}
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/