From c1fe8b7fd74eb6cc0d84fdb4811ab9d027539f62 Mon Sep 17 00:00:00 2001 From: Brian Foster Date: Wed, 18 Jul 2012 08:45:36 -0400 Subject: 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 Reviewed-on: http://review.gluster.com/3690 Tested-by: Gluster Build System Reviewed-by: Amar Tumballi Reviewed-by: Raghavendra Bhat Reviewed-by: Anand Avati --- xlators/mount/fuse/src/fuse-bridge.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'xlators') diff --git a/xlators/mount/fuse/src/fuse-bridge.c b/xlators/mount/fuse/src/fuse-bridge.c index d65de5f6..bf86cf73 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; -- cgit