Re: [PATCH] Remove pty_ops_bsd and pty_bsd_ioctl() as they're notused

From: Linus Torvalds
Date: Tue Sep 29 2009 - 12:24:39 EST




On Tue, 29 Sep 2009, David Howells wrote:
>
> Is it right to use pty_ops_bsd in _both_ places? Looking at the code in
> linux-2.6.0, the BSD ioctl only applies to the master and doesn't apply to the
> slave.

Right you are, good catch.

That said, I have to say that this whole pty lock thing seems to have been
broken since 2.6.26, and even now, nobody actually _complained_. You found
the problem due to a compiler warning rather than due to somebody noticing
that pty_bsd_ioctl() is no longer hooked up.

Because as far as I can tell, the bug was introduced by commit
3e8e88ca053150efdbecb45d8f481cf560ec808d ("pty: prepare for tty->ops
changes") back in April of 2008. That added the whole 'pty_ops_bsd'
structure, but it has never actually been used.

So I do wonder whether the right thing to do would not be to simple remove
the whole pty_ops_bsd code entirely. Or maybe mode the trivial TIOCSPTLCK
into the generic tty ioctl handling, and just make it test for
"driver->subtype == PTY_TYPE_MASTER" - and at least get rid of this subtle
thing that was broken for over a year without anybody noticing..

Linus
--
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/