Messages in this thread | | | Date | Fri, 8 Aug 2008 22:26:35 +0100 | From | Alan Cox <> | Subject | Re: [PATCH] vt: kill tty->count usage |
| |
> each driver can keep the number of the references itself. Holding tty_mutex > before calling driver's close() and updating tty->count is not possible > because some drivers sleep waiting until the tx buffer is empty.
Agreed.
> This patch was tested under normal usage and using the stress application I > wrote that triggers the problem more easily. > > + if (vc->vc_tty != NULL) { > + /* we're still releasing this console entry */ > + release_console_sem(); > + return -EBUSY;
That isn't valid behaviour according to the POSIX tty rules. An open of a closing tty blocks until the close completes. Most drivers using the TTY_CLOSING flag to handle this.
So NAK the patch but basically agree with the approach - the EBUSY needs to become a 'wait for close to complete, goto retry'
Alan
| |