aboutsummaryrefslogtreecommitdiff
path: root/sys/fs/fuse/fuse_vfsops.c
diff options
context:
space:
mode:
authorConrad Meyer <cem@FreeBSD.org>2019-02-15 22:50:31 +0000
committerConrad Meyer <cem@FreeBSD.org>2019-02-15 22:50:31 +0000
commit09176f096b48d4e766fc4445623075ced92929b3 (patch)
treeecc83d4082b76a7ac3644b281edc206dbbf67ee1 /sys/fs/fuse/fuse_vfsops.c
parent78a7722fbca9957189eeac93d13f42b9bcfb4c2e (diff)
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)
Notes
Notes: svn path=/head/; revision=344184
Diffstat (limited to 'sys/fs/fuse/fuse_vfsops.c')
-rw-r--r--sys/fs/fuse/fuse_vfsops.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/sys/fs/fuse/fuse_vfsops.c b/sys/fs/fuse/fuse_vfsops.c
index 5685b04ee0d8..ae17768ad2e6 100644
--- a/sys/fs/fuse/fuse_vfsops.c
+++ b/sys/fs/fuse/fuse_vfsops.c
@@ -444,7 +444,8 @@ fuse_vfsop_root(struct mount *mp, int lkflags, struct vnode **vpp)
if (err == 0)
*vpp = data->vroot;
} else {
- err = fuse_vnode_get(mp, FUSE_ROOT_ID, NULL, vpp, NULL, VDIR);
+ err = fuse_vnode_get(mp, NULL, FUSE_ROOT_ID, NULL, vpp, NULL,
+ VDIR);
if (err == 0) {
FUSE_LOCK();
MPASS(data->vroot == NULL || data->vroot == *vpp);