Re: madvise/fadvise 32-bit length

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 6/1/24 3:43 AM, Stefan wrote:
> io_uring uses the __u32 len field in order to pass the length to
> madvise and fadvise, but these calls use an off_t, which is 64bit on
> 64bit platforms.
> 
> When using liburing, the length is silently truncated to 32bits (so
> 8GB length would become zero, which has a different meaning of "until
> the end of the file" for fadvise).
> 
> If my understanding is correct, we could fix this by introducing new
> operations MADVISE64 and FADVISE64, which use the addr3 field instead
> of the length field for length.

We probably just want to introduce a flag and ensure that older stable
kernels check it, and then use a 64-bit field for it when the flag is
set.

-- 
Jens Axboe





[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux