Re: [PATCH 4/4] ->compat_ioctl for 390 tape_char
From: Arnd Bergmann
Date: Fri Nov 04 2005 - 18:09:15 EST
On Freedag 04 November 2005 23:18, Christoph Hellwig wrote:
> The only own ioctl, TAPE390_DISPLAY, is compat_clean, everything else
> is routed through common translation code.
>
>
> +tapechar_compat_ioctl(struct file *filp, unsigned int no, unsigned long data)
> +{
> + struct tape_device *device = filp->private_data;
> + int rval = -ENOIOCTLCMD;
> +
> + if (device->discipline->ioctl_fn) {
> + lock_kernel();
> + rval = device->discipline->ioctl_fn(device, no, data);
> + unlock_kernel();
> + }
> +
> + return rval;
> +}
Hmm, isn't ->compat_ioctl called before the translation lookup? If so,
this code would return -EINVAL from tape_34xx_ioctl and result in never
entering the conversion for MTIO* at all.
The same problem seems to be in the other patches of this series, but
I could also be mistaken.
BTW, I now have a set of 25 patches that moves all handlers from
fs/compat_ioctl.c over to the respective drivers and subsystems,
but I'm not sure how to best test that.
I intend to at least give it a test run on my Opteron for the whatever
ioctls I normally use, but the rest is just guesswork. Christoph,
can you review those patches?
Arnd <><
-
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/