From: Sage Weil Date: Wed, 17 Aug 2011 19:07:12 +0000 (-0700) Subject: cfuse: make use of fuse invalidate callback optional (and off by default) X-Git-Tag: v0.34~76 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=2df3f2c946a10cb321b4a36db2f93cb2b1cb0300;p=ceph.git cfuse: make use of fuse invalidate callback optional (and off by default) This is hitting a deadlock in fuse itself (or so it appears). Disable it until that's sorted out. Signed-off-by: Sage Weil --- diff --git a/src/client/fuse_ll.cc b/src/client/fuse_ll.cc index c31122e5899b..2d23deb23d58 100644 --- a/src/client/fuse_ll.cc +++ b/src/client/fuse_ll.cc @@ -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); diff --git a/src/common/config.cc b/src/common/config.cc index 76492864f880..097768b34349 100644 --- a/src/common/config.cc +++ b/src/common/config.cc @@ -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 diff --git a/src/common/config.h b/src/common/config.h index 0fffae842fa0..373162127a35 100644 --- a/src/common/config.h +++ b/src/common/config.h @@ -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;