]> git.baikalelectronics.ru Git - kernel.git/commit
vfs: fix up ENOIOCTLCMD error handling
authorLinus Torvalds <torvalds@linux-foundation.org>
Thu, 5 Jan 2012 23:40:12 +0000 (15:40 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Thu, 5 Jan 2012 23:40:12 +0000 (15:40 -0800)
commitf92481782db2a3384794619b61ef54e268a7b94c
tree6f257f877a9c2e653ca0515253e930fa6606239a
parentbf17f95934ad16844ebaeb69e55157d08f1294b9
vfs: fix up ENOIOCTLCMD error handling

We're doing some odd things there, which already messes up various users
(see the net/socket.c code that this removes), and it was going to add
yet more crud to the block layer because of the incorrect error code
translation.

ENOIOCTLCMD is not an error return that should be returned to user mode
from the "ioctl()" system call, but it should *not* be translated as
EINVAL ("Invalid argument").  It should be translated as ENOTTY
("Inappropriate ioctl for device").

That EINVAL confusion has apparently so permeated some code that the
block layer actually checks for it, which is sad.  We continue to do so
for now, but add a big comment about how wrong that is, and we should
remove it entirely eventually.  In the meantime, this tries to keep the
changes localized to just the EINVAL -> ENOTTY fix, and removing code
that makes it harder to do the right thing.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
block/ioctl.c
fs/compat_ioctl.c
fs/ioctl.c
net/socket.c