From 331ef6e1a86bfc0a93f8a9dec6ad35c417873849 Mon Sep 17 00:00:00 2001 From: Niels de Vos Date: Tue, 2 Dec 2014 10:54:53 +0100 Subject: nfs: make it possible to disable nfs.mount-rmtab When there are many NFS-clients doing very often mount/unmount actions, the updating of the 'rmtab' can become a bottleneck and cause delays. In these situations, the output of 'showmount' may be less important than the responsiveness of the (un)mounting. By setting 'nfs.mount-rmtab' to the value "/-", the cache file is not updated anymore, and the entries are only kept in memory. BUG: 1169317 Change-Id: I40c4d8d754932f86fb2b1b2588843390464c773d Reported-by: Cyril Peponnet Signed-off-by: Niels de Vos Reviewed-on: http://review.gluster.org/9223 Tested-by: Gluster Build System Reviewed-by: soumya k Reviewed-by: jiffin tony Thottan Reviewed-by: Kaleb KEITHLEY --- xlators/nfs/server/src/nfs.c | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) (limited to 'xlators/nfs/server/src/nfs.c') diff --git a/xlators/nfs/server/src/nfs.c b/xlators/nfs/server/src/nfs.c index 965aec7daa9..719682b236a 100644 --- a/xlators/nfs/server/src/nfs.c +++ b/xlators/nfs/server/src/nfs.c @@ -948,6 +948,12 @@ nfs_init_state (xlator_t *this) gf_log (GF_NFS, GF_LOG_ERROR, "Failed to parse dict"); goto free_foppool; } + + /* check if writing the rmtab is disabled*/ + if (nfs->rmtab && strcmp ("/-", nfs->rmtab) == 0) { + GF_FREE (nfs->rmtab); + nfs->rmtab = NULL; + } } /* support both options rpc-auth.ports.insecure and @@ -1176,7 +1182,13 @@ nfs_reconfigure_state (xlator_t *this, dict_t *options) } gf_path_strip_trailing_slashes (rmtab); } - if (strcmp (nfs->rmtab, rmtab) != 0) { + /* check if writing the rmtab is disabled*/ + if (strcmp ("/-", rmtab) == 0) { + GF_FREE (nfs->rmtab); + nfs->rmtab = NULL; + gf_log (GF_NFS, GF_LOG_INFO, + "Disabled writing of nfs.mount-rmtab"); + } else if (!nfs->rmtab || strcmp (nfs->rmtab, rmtab) != 0) { mount_rewrite_rmtab (nfs->mstate, rmtab); gf_log (GF_NFS, GF_LOG_INFO, "Reconfigured nfs.mount-rmtab path: %s", @@ -1914,7 +1926,8 @@ struct volume_options options[] = { "list all the NFS-clients that have connected " "through the MOUNT protocol. If this is on shared " "storage, all GlusterFS servers will update and " - "output (with 'showmount') the same list." + "output (with 'showmount') the same list. Set to " + "\"/-\" to disable." }, { .key = {OPT_SERVER_RPC_STATD}, .type = GF_OPTION_TYPE_PATH, -- cgit