Re: [PATCH] vt: kill tty->count usage

From: Alan Cox
Date: Fri Aug 08 2008 - 17:44:23 EST


> 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

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