Nick Bowler a25d426158 nvme: define compat_ioctl again to unbreak 32-bit userspace.
Commit 89b3d6e60550 ("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: 89b3d6e60550 ("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
..
2022-08-02 11:12:25 -07:00
2022-08-02 08:10:10 -07:00
2022-08-02 17:22:46 -06:00
2022-07-29 19:58:52 +02:00
2022-06-28 06:33:15 -06:00
2022-08-02 08:10:10 -07:00
2022-08-02 08:10:10 -07:00
2022-07-29 13:25:31 -07:00
2022-08-02 11:07:04 -07:00
2022-08-02 08:10:10 -07:00
2022-08-02 13:46:35 -07:00
2022-07-17 07:52:46 -07:00
2022-08-02 08:29:18 -07:00
2022-06-02 15:23:54 -07:00
2022-08-02 17:22:46 -06:00
2022-06-28 06:33:15 -06:00
2022-08-02 11:12:25 -07:00
2022-08-02 13:46:35 -07:00
2022-08-02 13:46:35 -07:00
2022-08-02 13:46:35 -07:00
2022-06-02 15:23:54 -07:00
2022-07-29 19:58:52 +02:00
2022-07-29 13:41:18 +02:00
2022-06-03 11:48:47 -07:00
2022-06-02 15:23:54 -07:00
2022-08-02 13:46:35 -07:00
2022-08-02 13:46:35 -07:00
2022-06-03 11:48:47 -07:00
2022-08-02 08:10:10 -07:00
2022-08-02 10:55:04 -07:00
2022-05-11 08:29:11 +03:00
2022-08-02 13:46:35 -07:00
2022-08-02 08:10:10 -07:00
2022-08-02 13:46:35 -07:00
2022-07-29 19:58:52 +02:00
2022-06-05 09:25:12 -07:00
2022-06-05 09:25:12 -07:00