Patch to 2.4.0-test5 to fix race in write_chan

From: Al Borchers (alborchers@steinerpoint.com)
Date: Sun Jul 30 2000 - 00:13:53 EST


Andrea Arcangeli patched 2.2.17 like this (thanks Andrea). We would like to
see the patch in 2.4.0 also.

It fixes a race in write_chan in n_tty.c when the wake up on tty->write
occurs in an interrupt handler. This has been a problem in the USB serial
drivers. We can mostly work around it on UP, but not on SMP. I posted
details and Andrea replied with the patch in linux-kernel on 6/28/2000.

Thanks,
-- Al Borchers

--- linux-2.4.0-test5-vanilla/drivers/char/n_tty.c Thu Jun 29 13:48:35 2000
+++ linux/drivers/char/n_tty.c Sat Jul 29 23:55:58 2000
@@ -1154,9 +1154,7 @@
                                 nr -= num;
                                 if (nr == 0)
                                         break;
- current->state = TASK_RUNNING;
                                 get_user(c, b);
- current->state = TASK_INTERRUPTIBLE;
                                 if (opost(c, tty) < 0)
                                         break;
                                 b++; nr--;
@@ -1164,9 +1162,7 @@
                         if (tty->driver.flush_chars)
                                 tty->driver.flush_chars(tty);
                 } else {
- current->state = TASK_RUNNING;
                         c = tty->driver.write(tty, 1, b, nr);
- current->state = TASK_INTERRUPTIBLE;
                         if (c < 0) {
                                 retval = c;
                                 goto break_out;

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Mon Jul 31 2000 - 21:00:31 EST