[lkml]   [1999]   [Feb]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
Patch in this message
SubjectRe: Linux-2.2.2-pre2..
On Sun, 7 Feb 1999, Andrea Arcangeli wrote:

>Supposing that I am right, I don't know if do_tty_hangup() is supposed to
>be run only from release_dev() and so I don't know if the real bug that is

Now I am forcing the kernel to run as in the case it wasn't racing.
Basically now when a master pty hangup it will put its do_tty_hangup
request in the new tq_tty_hangup task queue. Then when the _last_ slave
will hangup too the do_tty_hangup() of the master will run a bit before
releasing the tty struct memory.

I left the run_task_queue(&tq_scheduler) because I seen many tty lowlevel
drivers that are using it (just to be safe before removing the struct
under their eyes).

Works fine here.

Index: drivers/char//tty_io.c
RCS file: /var/cvs/linux/drivers/char/tty_io.c,v
retrieving revision
diff -u -r1.1.2.4 tty_io.c
--- tty_io.c 1999/01/31 22:44:47
+++ linux/drivers/char/tty_io.c 1999/02/07 19:48:18
@@ -54,6 +54,9 @@
* Added support for a Unix98-style ptmx device.
* -- C. Scott Ananian <>, 14-Jan-1998
+ *
+ * tq_tty_hangup
+ * -- Andrea Arcangeli, 7-Feb-1999

#include <linux/config.h>
@@ -115,6 +118,8 @@
struct tty_struct * redirect = NULL;

+static DECLARE_TASK_QUEUE(tq_tty_hangup);
static void initialize_tty_struct(struct tty_struct *tty);

static ssize_t tty_read(struct file *, char *, size_t, loff_t *);
@@ -491,7 +496,7 @@

printk("%s hangup...\n", tty_name(tty, buf));
- queue_task(&tty->tq_hangup, &tq_scheduler);
+ queue_task(&tty->tq_hangup, &tq_tty_hangup);

void tty_vhangup(struct tty_struct * tty)
@@ -1208,6 +1213,7 @@
+ run_task_queue(&tq_tty_hangup);

* The release_mem function takes care of the details of clearing

Andrea Arcangeli

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
Please read the FAQ at

 \ /
  Last update: 2005-03-22 13:50    [W:0.074 / U:0.548 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site