aboutsummaryrefslogtreecommitdiff
path: root/example
diff options
context:
space:
mode:
authorGravatar Nikolaus Rath <Nikolaus@rath.org>2017-04-06 11:47:06 -0700
committerGravatar Nikolaus Rath <Nikolaus@rath.org>2017-04-07 16:40:15 -0700
commitf7c5d10ce529d1e131113e155e3321d1fda1ebc2 (patch)
treed9447d6a45f60d684c1b65325f71b6eb6ed941e5 /example
parentd3c352142cdc738b4d224ff5960996cc5861c6e5 (diff)
passthrough, passthrough_fh: disable attribute caching
Required for better hardlink handling, see comments in patch.
Diffstat (limited to 'example')
-rw-r--r--example/passthrough.c12
-rw-r--r--example/passthrough_fh.c12
2 files changed, 24 insertions, 0 deletions
diff --git a/example/passthrough.c b/example/passthrough.c
index 15f424a..22e7083 100644
--- a/example/passthrough.c
+++ b/example/passthrough.c
@@ -52,6 +52,18 @@ static void *xmp_init(struct fuse_conn_info *conn,
{
(void) conn;
cfg->use_ino = 1;
+
+ /* Pick up changes from lower filesystem right away. This is
+ also necessary for better hardlink support. When the kernel
+ calls the unlink() handler, it does not know the inode of
+ the to-be-removed entry and can therefore not invalidate
+ the cache of the associated inode - resulting in an
+ incorrect st_nlink value being reported for any remaining
+ hardlinks to this inode. */
+ cfg->entry_timeout = 0;
+ cfg->attr_timeout = 0;
+ cfg->negative_timeout = 0;
+
return NULL;
}
diff --git a/example/passthrough_fh.c b/example/passthrough_fh.c
index c807d75..372282e 100644
--- a/example/passthrough_fh.c
+++ b/example/passthrough_fh.c
@@ -57,6 +57,18 @@ static void *xmp_init(struct fuse_conn_info *conn,
(void) conn;
cfg->use_ino = 1;
cfg->nullpath_ok = 1;
+
+ /* Pick up changes from lower filesystem right away. This is
+ also necessary for better hardlink support. When the kernel
+ calls the unlink() handler, it does not know the inode of
+ the to-be-removed entry and can therefore not invalidate
+ the cache of the associated inode - resulting in an
+ incorrect st_nlink value being reported for any remaining
+ hardlinks to this inode. */
+ cfg->entry_timeout = 0;
+ cfg->attr_timeout = 0;
+ cfg->negative_timeout = 0;
+
return NULL;
}