Whamcloud - gitweb
Branch b_release_1_6_7
authorbobijam <bobijam>
Wed, 1 Apr 2009 02:28:55 +0000 (02:28 +0000)
committerbobijam <bobijam>
Wed, 1 Apr 2009 02:28:55 +0000 (02:28 +0000)
b=18895
i=tappro
i=alexey.lyashkov (shadow)

when mds_setup() fails the error handle path needs clean possibly built
nid_stat which builds nid_proc on obd's obd_proc_exports_entry.

lustre/mds/handler.c
lustre/obdclass/lprocfs_status.c

index 200ea24..b6dbe14 100644 (file)
@@ -2184,7 +2184,9 @@ err_fs:
         mds_fs_cleanup(obd);
         upcall_cache_cleanup(mds->mds_group_hash);
         mds->mds_group_hash = NULL;
+        remove_proc_entry("clear", obd->obd_proc_exports_entry);
 err_ns:
+        lprocfs_free_per_client_stats(obd);
         lprocfs_free_obd_stats(obd);
         lprocfs_obd_cleanup(obd);
         ldlm_namespace_free(obd->obd_namespace, NULL, 0);
@@ -2631,7 +2633,7 @@ static int mds_intent_policy(struct ldlm_namespace *ns,
 
         unlock_res_and_lock(new_lock);
         lustre_hash_add(new_lock->l_export->exp_lock_hash,
-                        &new_lock->l_remote_handle, 
+                        &new_lock->l_remote_handle,
                         &new_lock->l_exp_hash);
         LDLM_LOCK_PUT(new_lock);
 
index 53a5bae..007eaa3 100644 (file)
@@ -1484,8 +1484,8 @@ int lprocfs_exp_setup(struct obd_export *exp, lnet_nid_t *nid, int *newnid)
             !exp->exp_obd->obd_nid_stats_hash)
                 RETURN(-EINVAL);
 
-       /* not test against zero because eric say:
-        * You may only test nid against another nid, or LNET_NID_ANY.
+        /* not test against zero because eric say:
+         * You may only test nid against another nid, or LNET_NID_ANY.
          * Anything else is nonsense.*/
         if (!nid || *nid == LNET_NID_ANY)
                 RETURN(0);
@@ -1573,7 +1573,6 @@ int lprocfs_exp_setup(struct obd_export *exp, lnet_nid_t *nid, int *newnid)
                                 lprocfs_exp_rd_hash, NULL, new_stat);
         if (rc) {
                 CWARN("Error adding the hash file\n");
-                lprocfs_remove(&new_stat->nid_proc);
                 GOTO(destroy_new_ns, rc);
         }
 
@@ -1587,6 +1586,8 @@ int lprocfs_exp_setup(struct obd_export *exp, lnet_nid_t *nid, int *newnid)
         RETURN(rc);
 
 destroy_new_ns:
+        if (new_stat->nid_proc != NULL)
+                lprocfs_remove(&new_stat->nid_proc);
         lustre_hash_del(obd->obd_nid_stats_hash, nid, &new_stat->nid_hash);
         OBD_FREE_PTR(new_ns_uuid);