summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrian Foster <bfoster@redhat.com>2012-07-18 08:45:36 -0400
committerAnand Avati <avati@redhat.com>2012-07-18 10:52:23 -0700
commitc1fe8b7fd74eb6cc0d84fdb4811ab9d027539f62 (patch)
tree2f20fbd2a8dcd4dd8a9076718928133e4d49198b
parentf2e0aad9e3f189a6d2b1cb72e94b55e0b9c043ff (diff)
mount/fuse: check for fuse inval notify support when fopen-keep-cache enabled
The fopen-keep-cache feature relies on the fuse notification system to operate correctly. As Csaba has pointed out, the inode invalidation functionality was added in FUSE version 7.12. Require that the user have 7.12 or later to enable fopen-keep-cache. If not supported, warn the user and disable the feature. BUG: 833564 Change-Id: Ib9eecb56b689d8edff118b34e2dcc7dba6539b04 Signed-off-by: Brian Foster <bfoster@redhat.com> Reviewed-on: http://review.gluster.com/3690 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Amar Tumballi <amarts@redhat.com> Reviewed-by: Raghavendra Bhat <raghavendra@redhat.com> Reviewed-by: Anand Avati <avati@redhat.com>
-rw-r--r--xlators/mount/fuse/src/fuse-bridge.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/xlators/mount/fuse/src/fuse-bridge.c b/xlators/mount/fuse/src/fuse-bridge.c
index d65de5f69a4..bf86cf73e63 100644
--- a/xlators/mount/fuse/src/fuse-bridge.c
+++ b/xlators/mount/fuse/src/fuse-bridge.c
@@ -3437,7 +3437,21 @@ fuse_init (xlator_t *this, fuse_in_header_t *finh, void *msg)
goto out;
}
priv->reverse_fuse_thread_started = _gf_true;
- }
+ } else {
+ /*
+ * FUSE minor < 12 does not implement invalidate notifications.
+ * This mechanism is required for fopen-keep-cache to operate
+ * correctly. Disable and warn the user.
+ */
+ if (priv->fopen_keep_cache) {
+ gf_log("glusterfs-fuse", GF_LOG_WARNING, "FUSE version "
+ "%d.%d does not support inval notifications. "
+ "fopen-keep-cache disabled.", fini->major,
+ fini->minor);
+ priv->fopen_keep_cache = 0;
+ }
+ }
+
if (fini->minor >= 13) {
/* these values seemed to work fine during testing */
fino.max_background = 64;