Whamcloud - gitweb
LU-462 Don't alloc/free client data for self export
[fs/lustre-release.git] / lustre / mgs / mgs_handler.c
index d1e4b65..e48acb7 100644 (file)
@@ -793,6 +793,9 @@ static inline int mgs_init_export(struct obd_export *exp)
         exp->exp_connecting = 1;
         cfs_spin_unlock(&exp->exp_lock);
 
+        /* self-export doesn't need client data and ldlm initialization */
+        if (unlikely(exp == exp->exp_obd->obd_self_export))
+                return 0;
         return ldlm_init_export(exp);
 }
 
@@ -802,6 +805,10 @@ static inline int mgs_destroy_export(struct obd_export *exp)
 
         target_destroy_export(exp);
         mgs_client_free(exp);
+
+        if (unlikely(exp == exp->exp_obd->obd_self_export))
+                RETURN(0);
+
         ldlm_destroy_export(exp);
 
         RETURN(0);