lkml.org 
[lkml]   [2022]   [Jul]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH] nvme: Define compat_ioctl again to unbreak 32-bit userspace.
On 2022-07-19, Guixin Liu <kanie@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

\
 
 \ /
  Last update: 2022-07-21 05:57    [W:0.052 / U:0.656 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site