Subject: Re: ioctl32 unknown cmds with 2.6.24-rc1

From: Arnd Bergmann <[email-masked]>
Date: Thu, 25 Oct 2007 17:19:52 +0200

On Thursday 25 October 2007, Geert Uytterhoeven wrote:
> In many cases these ioctls can indeed not be handled.
> E.g. when using `hdparm -tT /dev/ps3da', hdparm issues an ioctl to flush the
> cache. But this ioctl is not supported, not before and not after 2.6.23.
> Before 2.6.23, it didn't print the message, in 2.6.23, it does.

What I would expect to happen here is:

compat_blkdev_ioctl gets into the BLKFLSBUF case and calls blkdev_ioctl,
which calls blkdev_driver_ioctl, which returns -ENOTTY because
ps3disk_fops does not contain an unlocked_ioctl() or ioctl() method.

compat_sys_ioctl then detects that BLKFLSBUF was already handled by
compat_blkdev_ioctl (it did not return -ENOIOCTLCMD) and propagates
the error code to user space, without printing the message.

Whatever is different from that description must be what goes wrong.

	Arnd <><