Re: 2.6.5-rc2-mm5

From: Andrew Morton
Date: Mon Mar 29 2004 - 05:27:13 EST

Russell King <rmk+lkml@xxxxxxxxxxxxxxxx> wrote:
> On Mon, Mar 29, 2004 at 01:45:25AM -0800, Andrew Morton wrote:
> > +remove-down_tty_sem.patch
> > +tty-locking-again.patch
> >
> > Really, really fix the tty open/close race.
> Erm, note that tty drivers are supposed to handle the open/close stuff
> themselves,

They cannot. This bug relates to racy handling of tty->count at the
tty_io.c level. If the driver's ->close sleeps and drops the BKL.

> and it is completely valid for ->close to be called while
> another thread is in ->open. In fact, it's desirable since ->open may
> be waiting for the DCD line from a modem to activate, while there may
> be a simultaneous O_NONBLOCK open/ioctl/close from stty.

->open is not called under tty_sem. With this change, ->close is called
under tty_sem.

Are ->close implementations likely to block on hardware events?
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at
Please read the FAQ at