linux/drivers/nvme/host
masahiro31.yamada@kioxia.com c225b61031 nvme: Add compat_ioctl handler for NVME_IOCTL_SUBMIT_IO
Currently 32 bit application gets ENOTTY when it calls
compat_ioctl with NVME_IOCTL_SUBMIT_IO in 64 bit kernel.

The cause is that the results of sizeof(struct nvme_user_io),
which is used to define NVME_IOCTL_SUBMIT_IO,
are not same between 32 bit compiler and 64 bit compiler.

* 32 bit: the result of sizeof nvme_user_io is 44.
* 64 bit: the result of sizeof nvme_user_io is 48.

64 bit compiler seems to add 32 bit padding for multiple of 8 bytes.

This patch adds a compat_ioctl handler.
The handler replaces NVME_IOCTL_SUBMIT_IO32 with NVME_IOCTL_SUBMIT_IO
in case 32 bit application calls compat_ioctl for submit in 64 bit kernel.
Then, it calls nvme_ioctl as usual.

Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Masahiro Yamada (KIOXIA) <masahiro31.yamada@kioxia.com>
Signed-off-by: Keith Busch <kbusch@kernel.org>
2020-03-26 04:51:55 +09:00
..
core.c nvme: Add compat_ioctl handler for NVME_IOCTL_SUBMIT_IO 2020-03-26 04:51:55 +09:00
fabrics.c nvme-fabrics: Use scnprintf() for avoiding potential buffer overflow 2020-03-26 04:51:55 +09:00
fabrics.h nvme: Remove ADMIN_ONLY state 2019-10-14 23:21:44 +09:00
fault_inject.c nvme: enable to inject errors into admin commands 2019-06-21 11:15:50 +02:00
fc.c nvme-fc: fix double-free scenarios on hw queues 2019-11-27 03:00:13 +09:00
hwmon.c nvme: hwmon: switch to use <linux/units.h> helpers 2020-01-31 10:30:40 -08:00
Kconfig nvme: Don't deter users from enabling hwmon support 2020-03-26 04:45:25 +09:00
lightnvm.c lightnvm: move metadata mapping to lower level driver 2019-08-06 08:20:10 -06:00
Makefile nvme: Add hardware monitoring support 2019-11-12 01:57:35 +09:00
multipath.c nvme-multipath: do not reset on unknown status 2020-03-26 04:51:55 +09:00
nvme.h nvme-multipath: do not reset on unknown status 2020-03-26 04:51:55 +09:00
pci.c nvme-pci: properly print controller address 2020-03-26 04:51:54 +09:00
rdma.c nvme: prevent warning triggered by nvme_stop_keep_alive 2020-02-14 10:12:04 -07:00
tcp.c nvme-tcp: break from io_work loop if recv failed 2020-03-26 04:51:45 +09:00
trace.c nvme: trace: parse Get LBA Status command in detail 2019-08-29 12:55:01 -07:00
trace.h nvme-trace: print result and status in hex format 2019-06-21 11:12:37 +02:00