Whamcloud - gitweb
b=21420 MDS panic and hanging client processes
authorLiuYing <Emoly.Liu@Sun.COM>
Mon, 28 Dec 2009 01:01:46 +0000 (09:01 +0800)
committerroot <root@msiwind.(none)>
Mon, 28 Dec 2009 13:00:07 +0000 (16:00 +0300)
Replace exp_ops_stats with exp_nid_stats->nid_stats

i=wangdi
i=nathan

lustre/include/lustre_export.h
lustre/ldlm/ldlm_lib.c
lustre/mgs/lproc_mgs.c
lustre/mgs/mgs_fs.c
lustre/obdclass/lprocfs_status.c

index e4887a4..ff1e23c 100644 (file)
@@ -139,7 +139,6 @@ struct obd_export {
         struct obd_device        *exp_obd;
         struct obd_import        *exp_imp_reverse; /* to make RPCs backwards */
         struct nid_stat          *exp_nid_stats;
-        struct lprocfs_stats     *exp_ops_stats;
         struct ptlrpc_connection *exp_connection;
         __u32                     exp_conn_cnt;
         lustre_hash_t            *exp_lock_hash; /* existing lock hash */
index a0e8768..5ffa243 100644 (file)
@@ -552,11 +552,9 @@ int server_disconnect_export(struct obd_export *exp)
         }
         spin_unlock(&exp->exp_lock);
 
-
         /* release nid stat refererence */
         lprocfs_exp_cleanup(exp);
 
-
         RETURN(rc);
 }
 
index f14320e..7b5863a 100644 (file)
@@ -184,8 +184,10 @@ struct lprocfs_vars lprocfs_mgs_module_vars[] = {
 
 void mgs_counter_incr(struct obd_export *exp, int opcode)
 {
-        lprocfs_counter_incr(exp->exp_obd->obd_stats, opcode);
-        lprocfs_counter_incr(exp->exp_ops_stats, opcode);
+        if (exp->exp_obd && exp->exp_obd->obd_stats)
+                lprocfs_counter_incr(exp->exp_obd->obd_stats, opcode);
+        if (exp->exp_nid_stats && exp->exp_nid_stats->nid_stats)
+                lprocfs_counter_incr(exp->exp_nid_stats->nid_stats, opcode);
 }
 
 void mgs_stats_counter_init(struct lprocfs_stats *stats)
index 60fb831..7ee3eb1 100644 (file)
@@ -77,29 +77,35 @@ int mgs_export_stats_init(struct obd_device *obd,
         }
 
         if (newnid) {
+                struct nid_stat *tmp = exp->exp_nid_stats;
+
                 num_stats = (sizeof(*obd->obd_type->typ_ops) / sizeof(void *)) +
                              LPROC_MGS_LAST - 1;
-                exp->exp_ops_stats = lprocfs_alloc_stats(num_stats,
+                tmp->nid_stats = lprocfs_alloc_stats(num_stats,
                                                 LPROCFS_STATS_FLAG_NOPERCPU);
-                if (exp->exp_ops_stats == NULL)
+                if (tmp->nid_stats == NULL)
                         return -ENOMEM;
-                lprocfs_init_ops_stats(LPROC_MGS_LAST, exp->exp_ops_stats);
-                mgs_stats_counter_init(exp->exp_ops_stats);
-                lprocfs_register_stats(exp->exp_nid_stats->nid_proc, "stats",
-                                       exp->exp_ops_stats);
+
+                lprocfs_init_ops_stats(LPROC_MGS_LAST, tmp->nid_stats);
+                mgs_stats_counter_init(tmp->nid_stats);
+                rc = lprocfs_register_stats(tmp->nid_proc, "stats",
+                                            tmp->nid_stats);
+                if (rc)
+                        return rc;
 
                 /* Always add in ldlm_stats */
-                exp->exp_nid_stats->nid_ldlm_stats =
+                tmp->nid_ldlm_stats =
                         lprocfs_alloc_stats(LDLM_LAST_OPC - LDLM_FIRST_OPC,
                                             LPROCFS_STATS_FLAG_NOPERCPU);
-                if (exp->exp_nid_stats->nid_ldlm_stats == NULL)
+                if (tmp->nid_ldlm_stats == NULL)
                         return -ENOMEM;
 
-                lprocfs_init_ldlm_stats(exp->exp_nid_stats->nid_ldlm_stats);
+                lprocfs_init_ldlm_stats(tmp->nid_ldlm_stats);
 
-                rc = lprocfs_register_stats(exp->exp_nid_stats->nid_proc,
-                                            "ldlm_stats",
-                                            exp->exp_nid_stats->nid_ldlm_stats);
+                rc = lprocfs_register_stats(tmp->nid_proc, "ldlm_stats",
+                                            tmp->nid_ldlm_stats);
+                if (rc)
+                        return rc;
         }
 
         return 0;
index 16ddf73..a666d1a 100644 (file)
@@ -1776,7 +1776,6 @@ int lprocfs_exp_cleanup(struct obd_export *exp)
 
         nidstat_putref(exp->exp_nid_stats);
         exp->exp_nid_stats = NULL;
-        lprocfs_free_stats(&exp->exp_ops_stats);
 
         return 0;
 }