summaryrefslogtreecommitdiffstats
path: root/xlators/nfs/server
diff options
context:
space:
mode:
Diffstat (limited to 'xlators/nfs/server')
-rw-r--r--xlators/nfs/server/src/nlm4.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/xlators/nfs/server/src/nlm4.c b/xlators/nfs/server/src/nlm4.c
index c3c1453a091..957f424fd42 100644
--- a/xlators/nfs/server/src/nlm4.c
+++ b/xlators/nfs/server/src/nlm4.c
@@ -57,6 +57,8 @@ gf_lock_t nlm_client_list_lk;
/* race on this is harmless */
int nlm_grace_period = 50;
+static gf_boolean_t nlm4_inited = _gf_false;
+
#define nlm4_validate_nfs3_state(request, state, status, label, retval) \
do { \
state = rpcsvc_request_program_private(request); \
@@ -2574,7 +2576,6 @@ nlm4svc_init(xlator_t *nfsx)
};
FILE *pidfile = NULL;
pid_t pid = -1;
- static gf_boolean_t nlm4_inited = _gf_false;
/* Already inited */
if (nlm4_inited)
@@ -2733,7 +2734,7 @@ nlm_priv(xlator_t *this)
gf_proc_dump_add_section("nfs.nlm");
- if (TRY_LOCK(&nlm_client_list_lk))
+ if ((nlm4_inited == _gf_false) || TRY_LOCK(&nlm_client_list_lk))
goto out;
list_for_each_entry(client, &nlm_client_list, nlm_clients)
@@ -2766,7 +2767,8 @@ out:
gf_proc_dump_build_key(key, "nlm", "statedump_error");
gf_proc_dump_write(key,
"Unable to dump nlm state because "
- "nlm_client_list_lk lock couldn't be acquired");
+ "nlm is not initialised or nlm_client_list_lk "
+ "lock couldn't be acquired");
}
return ret;