]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
cfuse: make use of fuse invalidate callback optional (and off by default)
authorSage Weil <sage@newdream.net>
Wed, 17 Aug 2011 19:07:12 +0000 (12:07 -0700)
committerSage Weil <sage@newdream.net>
Wed, 17 Aug 2011 19:25:56 +0000 (12:25 -0700)
This is hitting a deadlock in fuse itself (or so it appears).  Disable it
until that's sorted out.

Signed-off-by: Sage Weil <sage@newdream.net>
src/client/fuse_ll.cc
src/common/config.cc
src/common/config.h

index c31122e5899be50b1e2e87c5aafb0fe4add8af0c..2d23deb23d58b1e799a8b5f500f1b9bd325e9a94 100644 (file)
@@ -322,7 +322,8 @@ static void ceph_ll_open(fuse_req_t req, fuse_ino_t ino, struct fuse_file_info *
   if (r == 0) {
     fi->fh = (long)fh;
 #if FUSE_VERSION >= FUSE_MAKE_VERSION(2, 8)
-    fi->keep_cache = 1;
+    if (g_conf->fuse_use_invalidate_cb)
+      fi->keep_cache = 1;
 #endif
     fuse_reply_open(req, fi);
   } else {
@@ -569,6 +570,7 @@ int ceph_fuse_ll_main(Client *c, int argc, const char *argv[], int fd)
   // go go gadget fuse
   struct fuse_args args = FUSE_ARGS_INIT(newargc, (char**)newargv);
   struct fuse_chan *ch = NULL;
+  struct fuse_chan *ch_inval = NULL;
   struct fuse_session *se = NULL;
   char *mountpoint = NULL;
   int ret = 0;
@@ -602,8 +604,10 @@ int ceph_fuse_ll_main(Client *c, int argc, const char *argv[], int fd)
   }
 
   fuse_session_add_chan(se, ch);
+  fuse_session_add_chan(se, ch_inval);
 
-  client->ll_register_ino_invalidate_cb(invalidate_cb, ch);
+  if (g_conf->fuse_use_invalidate_cb)
+    client->ll_register_ino_invalidate_cb(invalidate_cb, ch);
 
   ret = fuse_session_loop(se);
 
index 76492864f880e3cf003c3884cfe8282fba17b53a..097768b34349ee4114313f8c91e975b6cb63907a 100644 (file)
@@ -230,6 +230,7 @@ struct config_option config_optionsp[] = {
   OPTION(client_oc_target_dirty, OPT_INT, 1024*1024* 8), // target dirty (keep this smallish)
   // note: the max amount of "in flight" dirty data is roughly (max - target)
   OPTION(client_oc_max_sync_write, OPT_U64, 128*1024),   // sync writes >= this use wrlock
+  OPTION(fuse_use_invalidate_cb, OPT_BOOL, false), // use fuse 2.8+ invalidate callback to keep page cache consistent
   OPTION(objecter_tick_interval, OPT_DOUBLE, 5.0),
   OPTION(objecter_mon_retry_interval, OPT_DOUBLE, 5.0),
   OPTION(objecter_timeout, OPT_DOUBLE, 10.0),    // before we ask for a map
index 0fffae842fa0be3a7b7c9d38dde3af8ffd2542ca..373162127a35ede61de4a2b4604c8c27dcc6d0df 100644 (file)
@@ -315,6 +315,9 @@ public:
 
   int      client_notify_timeout;
 
+  // fuse
+  bool fuse_use_invalidate_cb;
+
   // objecter
   double objecter_mon_retry_interval;
   double objecter_tick_interval;