[PATCH] nvme: Define compat_ioctl again to unbreak 32-bit userspace.
Nick Bowler
nbowler at draconx.ca
Wed Jul 20 20:56:39 PDT 2022
On 2022-07-19, Guixin Liu <kanie at linux.alibaba.com> wrote:
> 在 2022/7/20 09:55, Nick Bowler 写道:
[...]
>> diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c
>> index a2862a56fadc..30e105dbc178 100644
>> --- a/drivers/nvme/host/core.c
>> +++ b/drivers/nvme/host/core.c
>> @@ -2093,6 +2093,7 @@ static int nvme_report_zones(struct gendisk *disk,
>> sector_t sector,
>> static const struct block_device_operations nvme_bdev_ops = {
>> .owner = THIS_MODULE,
>> .ioctl = nvme_ioctl,
>> + .compat_ioctl = nvme_ioctl,
>> .open = nvme_open,
>> .release = nvme_release,
>> .getgeo = nvme_getgeo,
[...]
> Should this in the brace of "#ifdef CONFIG_COMPAT" and "#endif"?
I think it doesn't make any significant difference either way -- the
.compat_ioctl member is always present in the block_device_operations
structure. Unconditional assignment thus seems more sensible to me.
v2 uses blkdev_compat_ptr_ioctl which expands to NULL for !CONFIG_COMPAT.
Thanks,
Nick
More information about the Linux-nvme
mailing list