Re: Broken ioctl error returns (was Re: [PATCH 2/3] block: fail SCSIpassthrough ioctls on partition devices)

From: Linus Torvalds
Date: Thu Jan 05 2012 - 12:39:00 EST


On Thu, Jan 5, 2012 at 9:26 AM, Paolo Bonzini <pbonzini@xxxxxxxxxx> wrote:
> On 01/05/2012 06:02 PM, Linus Torvalds wrote:
>>
>> +       return  ret == -EINVAL ||
>> +               ret == -ENOTTY ||
>> +               ret == ENOIOCTLCMD;
>
>
> Missing minus before ENOIOCTLCMD.

Oops, thanks, fixed.

Also, I do realize that the patch results in a warning about
"compat_ioctl_error()" no longer being used. I've removed it in my
tree, but I do wonder if we could perhaps have some kind of better
check, so maybe it is useful if somebody can come up with a saner way
to do it. Or at least a way that doesn't cause the kind of crazy code
that net/socket.c had.

And I notice that not only net/socket.c had workarounds for the bogus
warning, but fs/compat_ioctl.c itself does too: it's why we have those
IGNORE_IOCTL() entries.

So *maybe* we can reinstate that compat_ioctl_error() check, and just
remove the net/socket.c stuff, and make sure that all the ioctls that
net/socket.c had hacks for are mentioned as IGNORE_IOCTL's. Dunno.

Anybody have strong opinions either way? Has that printout helped
compat ioctl debugging a lot lately and we really want to maintain it?
Otherwise I'm inclined to remove it (we can always reinstate it later,
it's not like removal is necessarily final).

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/