Re: [fuse-devel] Handling of 32/64 bit off_t by getdents64()

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

 



On Nov 27 2019, Miklos Szeredi <miklos@xxxxxxxxxx> wrote:
>> Is there a way for a 64 bit process (in this case the FUSE daemon) to
>> ask for 32 bit d_off values from getdents64()?
>
> Looking at ext4 d_off encoding, it looks like the simple workaround is
> to use the *high* 32 bits of the offset.
>
> Just tried, and this works.  The lower bits are the "minor" number of
> the offset, and no issue with zeroing those bits out, other than
> increasing the chance of hash collision from practically zero to very
> close to zero.
>
>> Would it be feasible to extend the FUSE protocol to include information
>> about the available bits in d_off?
>
> Yes.
>
> The relevant bits from ext4 are:
>
> static inline int is_32bit_api(void)
> {
> #ifdef CONFIG_COMPAT
>     return in_compat_syscall();
> #else
>     return (BITS_PER_LONG == 32);
> #endif
> }

Thanks for the quick response!

Is there a way to do the same without relying on ext4 internals, i.e. by
manually calling getdents64() in such a way that in_compat_syscall()
gives true even if the caller is 64 bit?



Best,
-Nikolaus

-- 
GPG Fingerprint: ED31 791B 2C5C 1613 AF38 8B8A D113 FCAC 3C4E 599F

             »Time flies like an arrow, fruit flies like a Banana.«




[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]

  Powered by Linux