Re: [PATCH 1/1] libfuse: don't put HAVE_STATX in a public header

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

 



On 8/22/25 02:33, Joanne Koong wrote:
> On Wed, Aug 20, 2025 at 6:01 PM Darrick J. Wong <djwong@xxxxxxxxxx> wrote:
>>
>> From: Darrick J. Wong <djwong@xxxxxxxxxx>
>>
>> fuse.h and fuse_lowlevel.h are public headers, don't expose internal
>> build system config variables to downstream clients.  This can also lead
>> to function pointer ordering issues if (say) libfuse gets built with
>> HAVE_STATX but the client program doesn't define a HAVE_STATX.
>>
>> Get rid of the conditionals in the public header files to fix this.
>>
>> Signed-off-by: "Darrick J. Wong" <djwong@xxxxxxxxxx>
>> ---
>>  include/fuse.h           |    2 --
>>  include/fuse_lowlevel.h  |    2 --
>>  example/memfs_ll.cc      |    2 +-
>>  example/passthrough.c    |    2 +-
>>  example/passthrough_fh.c |    2 +-
>>  example/passthrough_ll.c |    2 +-
>>  6 files changed, 4 insertions(+), 8 deletions(-)
>>
>>
>> diff --git a/include/fuse.h b/include/fuse.h
>> index 06feacb070fbfb..209102651e9454 100644
>> --- a/include/fuse.h
>> +++ b/include/fuse.h
>> @@ -854,7 +854,6 @@ struct fuse_operations {
>>          */
>>         off_t (*lseek) (const char *, off_t off, int whence, struct fuse_file_info *);
>>
>> -#ifdef HAVE_STATX
>>         /**
>>          * Get extended file attributes.
>>          *
>> @@ -865,7 +864,6 @@ struct fuse_operations {
>>          */
>>         int (*statx)(const char *path, int flags, int mask, struct statx *stxbuf,
>>                      struct fuse_file_info *fi);
>> -#endif
>>  };
> 
> Are we able to just remove this ifdef? Won't this break compilation on
> old systems that don't recognize "struct statx"?

Yeah, you had added forward declaration actually. Slipped through in
my review that we don't need the HAVE_STATX anymore.

We can also extend the patch a bit to remove HAVE_STATX from the public
config. 
Another alternative for this patch would be to replace HAVE_STATX by
HAVE_FUSE_STATX.
The commit message is also not entirely right, as it says

> to function pointer ordering issues if (say) libfuse gets built with
> HAVE_STATX but the client program doesn't define a HAVE_STATX.

Actually not, because /usr/include/fuse3/libfuse_config.h defines HAVE_STATX.
I'm more worried that there might be a conflict of HAVE_STATX from libfuse
with HAVE_STATX from the application.


Thanks,
Bernd




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

  Powered by Linux