linux/drivers/nvme/host
Nick Bowler a25d426158 nvme: define compat_ioctl again to unbreak 32-bit userspace.
Commit 89b3d6e605 ("nvme: simplify the compat ioctl handling") removed
the initialization of compat_ioctl from the nvme block_device_operations
structures.

Presumably the expectation was that 32-bit ioctls would be directed
through the regular handler but this is not the case: failing to assign
.compat_ioctl actually means that the compat case is disabled entirely,
and any attempt to submit nvme ioctls from 32-bit userspace fails
outright with -ENOTTY.

For example:

  % smartctl -x /dev/nvme0n1
  [...]
  Read NVMe Identify Controller failed: NVME_IOCTL_ADMIN_CMD: Inappropriate ioctl for device

The blkdev_compat_ptr_ioctl helper can be used to direct compat calls
through the main ioctl handler and makes things work again.

Fixes: 89b3d6e605 ("nvme: simplify the compat ioctl handling")
Signed-off-by: Nick Bowler <nbowler@draconx.ca>
Reviewed-by: Guixin Liu <kanie@linux.alibaba.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2022-08-02 17:22:48 -06:00
..
apple.c nvme-apple: use nvme core helper to cancel requests in tagset 2022-08-02 17:22:41 -06:00
auth.c nvme-auth: Diffie-Hellman key exchange support 2022-08-02 17:14:49 -06:00
constants.c nvme: don't always build constants.o 2022-08-02 17:22:48 -06:00
core.c nvme: define compat_ioctl again to unbreak 32-bit userspace. 2022-08-02 17:22:48 -06:00
fabrics.c nvme: implement In-Band authentication 2022-08-02 17:14:49 -06:00
fabrics.h nvme: implement In-Band authentication 2022-08-02 17:14:49 -06:00
fault_inject.c block: remove the ->rq_disk field in struct request 2021-11-29 06:41:29 -07:00
fc.c blk-mq: Drop 'reserved' arg of busy_tag_iter_fn 2022-07-06 06:33:53 -06:00
fc.h nvme-fc: Update header and host for common definitions for LS handling 2020-05-09 16:18:33 -06:00
hwmon.c nvme-hwmon: Return error code when registration fails 2021-03-05 13:41:03 +01:00
ioctl.c nvme/host: Use the enum req_op and blk_opf_t types 2022-07-14 12:14:32 -06:00
Kconfig nvme-auth: Diffie-Hellman key exchange support 2022-08-02 17:14:49 -06:00
Makefile nvme: don't always build constants.o 2022-08-02 17:22:48 -06:00
multipath.c nvme: define compat_ioctl again to unbreak 32-bit userspace. 2022-08-02 17:22:48 -06:00
nvme.h nvme-multipath: refactor nvme_mpath_add_disk 2022-08-02 17:22:41 -06:00
pci.c nvme-pci: use nvme core helper to cancel requests in tagset 2022-08-02 17:22:41 -06:00
rdma.c nvme-rdma: remove timeout for getting RDMA-CM established event 2022-08-02 17:22:41 -06:00
tcp.c nvme-tcp: use in-capsule data for I/O connect 2022-08-02 17:22:41 -06:00
trace.c nvme: implement In-Band authentication 2022-08-02 17:14:49 -06:00
trace.h nvme: use command_id instead of req->tag in trace_nvme_complete_rq() 2022-08-02 17:22:46 -06:00
zns.c block: pass a gendisk to blk_queue_max_open_zones and blk_queue_max_active_zones 2022-07-06 06:46:26 -06:00