Re: Fuse: directory cache eviction stopped working in the linux 6.9.X and onwards

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

 



Thanks Bernd for looking into this!

I think 6.9 added passthrough support. Are you using that?
> Not yet, but we have plans to try this out.

FOPEN_CACHE_DIR is default when there is no fuse-server open method
defined - does your implementation have an open/dir_open?
> Yes, here is the implementation in GCSFuse (internally uses jacobsa/fuse library) - https://github.com/GoogleCloudPlatform/gcsfuse/blob/b0ca9c5b2c0a35aeb8a48fe7a36120d7b33216aa/internal/fs/fs.go#L2328
Here, op.CacheDir maps to FOPEN_CACHE_DIR and op.KeepCache maps to
FOPEN_KEEP_CACHE.

I think the only user of FOPEN_CACHE_DIR is in fs/fuse/readdir.c and
that always checks if it is set - either the flag gets set or does not
come into role at all, because passthrough is used?
> Being honest, I don't have much idea of linux source code. As a user, to me the FOPEN_CACHE_DIR flag is working as expected.
The problem is with the FOPEN_KEEP_CACHE flags, setting this should
evict the dir cache, but it's not happening for linux 6.9.x and above.
Although I see  a line in fs/fuse/dir.c
(https://github.com/torvalds/linux/blob/ccb98ccef0e543c2bd4ef1a72270461957f3d8d0/fs/fuse/dir.c#L718)
which invalidates the inode pages if FOPEN_KEEP_CACHE is not set.

So my ultimate question would be:
(1) Do you see such recent changes in fs/fuse which explains the above
regression?
(2) If the changes are intentional, what should be the right way for
fuse-server to evict the dir-cache (other than auto eviction due to
change in dir-content, e.g., addition of new file inside a dir)?

Thanks,
Prince Kumar.


On Tue, Dec 31, 2024 at 5:11 AM Bernd Schubert <bernd@xxxxxxxxxxx> wrote:
>
>
>
> On 12/30/24 05:41, Prince Kumar wrote:
> > Hello Team,
> >
> > I see a regression in the fuse-filesystem for the linux version 6.9.X
> > and onwards, where the FOPEN_KEEP_CACHE flag is not working as
> > intended. Just for background, I referred to this linux commit
> > (https://github.com/torvalds/linux/commit/6433b8998a21dc597002731c4ceb4144e856edc4)
> > to implement directory listing cache in jacobsa/fuse
> > (https://github.com/jacobsa/fuse/pull/162).
> >
> > Ideally, the kernel directory cache should be evicted if the
> > user-daemon doesn't set FOPEN_KEEP_CACHE bit as part of the OpenDir
> > response, but it's not getting evicted in the linux version 6.9.X and
> > onwards.
> >
> > Could you please help me in resolving this?
>
> I think 6.9 added passthrough support. Are you using that? Also,
> FOPEN_CACHE_DIR is default when there is no fuse-server open method
> defined - does your implementation have an open/dir_open?
>
> I think the only user of FOPEN_CACHE_DIR is in fs/fuse/readdir.c and
> that always checks if it is set - either the flag gets set or does not
> come into role at all, because passthrough is used?
>
>
> 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