Whamcloud - gitweb
LU-2835 ptlrpc: Fix race during exp_flock_hash creation
[fs/lustre-release.git] / lustre / ldlm / ldlm_lockd.c
index 2f11b93..1cfd813 100644 (file)
@@ -2775,6 +2775,7 @@ static cfs_hash_ops_t ldlm_export_lock_ops = {
 
 int ldlm_init_export(struct obd_export *exp)
 {
 
 int ldlm_init_export(struct obd_export *exp)
 {
+       int rc;
         ENTRY;
 
         exp->exp_lock_hash =
         ENTRY;
 
         exp->exp_lock_hash =
@@ -2790,7 +2791,14 @@ int ldlm_init_export(struct obd_export *exp)
         if (!exp->exp_lock_hash)
                 RETURN(-ENOMEM);
 
         if (!exp->exp_lock_hash)
                 RETURN(-ENOMEM);
 
+       rc = ldlm_init_flock_export(exp);
+       if (rc)
+               GOTO(err, rc);
+
         RETURN(0);
         RETURN(0);
+err:
+       ldlm_destroy_export(exp);
+       RETURN(rc);
 }
 EXPORT_SYMBOL(ldlm_init_export);
 
 }
 EXPORT_SYMBOL(ldlm_init_export);