public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/1] Char: tty_io, fix closecount counting
@ 2008-05-26 14:08 Jiri Slaby
  2008-05-26 15:22 ` Jiri Slaby
  2008-05-31 11:50 ` Jiri Slaby
  0 siblings, 2 replies; 6+ messages in thread
From: Jiri Slaby @ 2008-05-26 14:08 UTC (permalink / raw)
  To: Andrew Morton; +Cc: linux-kernel, Jiri Slaby, Alan Cox

Alan, please N/ACK this.

--

filp->f_op->write never equals to tty_write for the console device, so
closecount++ is never reached and we don't close console device so many
times we open it before. (The closecount is used only for /dev/console.)

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

Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
---
 drivers/char/tty_io.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/char/tty_io.c b/drivers/char/tty_io.c
index c9e6e24..8c7b6ed 100644
--- 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;
 	}
-- 
1.5.4.5


^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2008-06-03 20:49 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-05-26 14:08 [PATCH 1/1] Char: tty_io, fix closecount counting Jiri Slaby
2008-05-26 15:22 ` Jiri Slaby
2008-05-31 11:50 ` Jiri Slaby
2008-05-31 11:51   ` Jiri Slaby
2008-05-31 13:43   ` Alan Cox
2008-06-03 20:46     ` Jiri Slaby

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox