lkml.org 
[lkml]   [2000]   [Jul]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectPatch 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;
\
 
 \ /
  Last update: 2005-03-22 13:57    [W:0.033 / U:1.332 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site