diff options
author | Johannes Stezenbach <js@sig21.net> | 2011-07-01 16:32:26 -0400 |
---|---|---|
committer | Jens Axboe <jaxboe@fusionio.com> | 2011-07-01 16:32:26 -0400 |
commit | 390192b300570b2bc721d77067ca133f58015ae8 (patch) | |
tree | bacbd75f23e74308b814146338bcaa6b3636bae7 /include/linux/fd.h | |
parent | 85ef06d1d252f6a2e73b678591ab71caad4667bb (diff) |
compat_ioctl: fix warning caused by qemu
On Linux x86_64 host with 32bit userspace, running
qemu or even just "qemu-img create -f qcow2 some.img 1G"
causes a kernel warning:
ioctl32(qemu-img:5296): Unknown cmd fd(3) cmd(00005326){t:'S';sz:0} arg(7fffffff) on some.img
ioctl32(qemu-img:5296): Unknown cmd fd(3) cmd(801c0204){t:02;sz:28} arg(fff77350) on some.img
ioctl 00005326 is CDROM_DRIVE_STATUS,
ioctl 801c0204 is FDGETPRM.
The warning appears because the Linux compat-ioctl handler for these
ioctls only applies to block devices, while qemu also uses the ioctls on
plain files.
Signed-off-by: Johannes Stezenbach <js@sig21.net>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
Diffstat (limited to 'include/linux/fd.h')
-rw-r--r-- | include/linux/fd.h | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/include/linux/fd.h b/include/linux/fd.h index f5d194af07a8..c6a68d011608 100644 --- a/include/linux/fd.h +++ b/include/linux/fd.h | |||
@@ -3,6 +3,7 @@ | |||
3 | 3 | ||
4 | #include <linux/ioctl.h> | 4 | #include <linux/ioctl.h> |
5 | #include <linux/compiler.h> | 5 | #include <linux/compiler.h> |
6 | #include <linux/compat.h> | ||
6 | 7 | ||
7 | /* New file layout: Now the ioctl definitions immediately follow the | 8 | /* New file layout: Now the ioctl definitions immediately follow the |
8 | * definitions of the structures that they use */ | 9 | * definitions of the structures that they use */ |
@@ -377,4 +378,21 @@ struct floppy_raw_cmd { | |||
377 | #define FDEJECT _IO(2, 0x5a) | 378 | #define FDEJECT _IO(2, 0x5a) |
378 | /* eject the disk */ | 379 | /* eject the disk */ |
379 | 380 | ||
381 | #ifdef CONFIG_COMPAT | ||
382 | struct compat_floppy_struct { | ||
383 | compat_uint_t size; | ||
384 | compat_uint_t sect; | ||
385 | compat_uint_t head; | ||
386 | compat_uint_t track; | ||
387 | compat_uint_t stretch; | ||
388 | unsigned char gap; | ||
389 | unsigned char rate; | ||
390 | unsigned char spec1; | ||
391 | unsigned char fmt_gap; | ||
392 | const compat_caddr_t name; | ||
393 | }; | ||
394 | |||
395 | #define FDGETPRM32 _IOR(2, 0x04, struct compat_floppy_struct) | ||
396 | #endif | ||
397 | |||
380 | #endif | 398 | #endif |