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

From: Linus Torvalds
Date: Fri Jan 06 2012 - 12:05:31 EST


On Fri, Jan 6, 2012 at 8:19 AM, Arnd Bergmann <arnd@xxxxxxxx> wrote:
>
> For a simpler solution, we could keep the old warning message, but change
> the logic from
>
> (.compat_ioctl == NULL || .compat_ioctl() == -ENOIOCTL) && (no generic handler)
>
> to
>
> (.ioctl != NULL && .compat_ioctl == NULL) && (no generic handler).
>
> and then fix the warnings we see by adding appropriate .compat_ioctl
> functions.

So I have no problem with that. What I did have problems with was the
net/socket.c kind of workarounds (which I noticed mainly because they
had that whole EINVAL confusion built into them). Those were why I
decided that the warning has to go.

But if you can re-introduce the warning without workarounds like
those, I have no problem with us reintroducing the warning, even if it
is technically not really kosher and will afaik still print that
warning for the case of a compat-ioctl transform that *would* have
been valid, just not for that particular file descriptor.

But the printout is small and not all that annoying, and explicitly
limited in number, so I guess I don't mind a few false positives if it
really can help find stale translation entries.

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/