Messages in this thread Patch in this message | | | Date | Sun, 30 Jul 2000 00:13:53 -0500 | From | Al Borchers <> | Subject | Patch to 2.4.0-test5 to fix race in write_chan |
| |
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; | |