]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
FUSE: Respect userspace FS "do-not-cache" of path components
authorcem <cem@FreeBSD.org>
Fri, 15 Feb 2019 22:50:31 +0000 (22:50 +0000)
committercem <cem@FreeBSD.org>
Fri, 15 Feb 2019 22:50:31 +0000 (22:50 +0000)
commit6ce2686c1514bbb35834df3eb4f91dc5a1c2675b
treeecc83d4082b76a7ac3644b281edc206dbbf67ee1
parentfde561aa6ecded8a70bb2d9a44dbb69baf9b953d
FUSE: Respect userspace FS "do-not-cache" of path components

The FUSE protocol demands that kernel implementations cache user filesystem
path components (lookup/cnp data) for a maximum period of time in the range
of [0, ULONG_MAX] seconds.  In practice, typical requests are for 0, 1, or
10 seconds; or "a long time" to represent indefinite caching.

Historically, FreeBSD FUSE has ignored this client directive entirely.  This
works fine for local-only filesystems, but causes consistency issues with
multi-writer network filesystems.

For now, respect 0 second cache TTLs and do not cache such metadata.
Non-zero metadata caching TTLs in the range [0.000000001, ULONG_MAX] seconds
are still cached indefinitely, because it is unclear how a userspace
filesystem could do anything sensible with those semantics even if
implemented.

Pass fuse_entry_out to fuse_vnode_get when available and only cache lookup
if the user filesystem did not set a zero second TTL.

PR: 230258 (inspired by; does not fix)
sys/fs/fuse/fuse_internal.c
sys/fs/fuse/fuse_node.c
sys/fs/fuse/fuse_node.h
sys/fs/fuse/fuse_vfsops.c
sys/fs/fuse/fuse_vnops.c