Skip to content
Commit a25d4261 authored by Nick Bowler's avatar Nick Bowler Committed by Jens Axboe
Browse files

nvme: define compat_ioctl again to unbreak 32-bit userspace.



Commit 89b3d6e6 ("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: 89b3d6e6 ("nvme: simplify the compat ioctl handling")
Signed-off-by: default avatarNick Bowler <nbowler@draconx.ca>
Reviewed-by: default avatarGuixin Liu <kanie@linux.alibaba.com>
Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent eb7e2d92
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment