From fba0b84f2ec603ee1eb9aeacc59f4ab60daa7323 Mon Sep 17 00:00:00 2001
From: bobijam <bobijam>
Date: Wed, 5 Mar 2008 07:24:49 +0000
Subject: [PATCH] Branch b1_6 b=14873 i=johann i=shadow

protect competitive adding to obd->obd_nid_stats.
---
 lustre/obdclass/lprocfs_status.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/lustre/obdclass/lprocfs_status.c b/lustre/obdclass/lprocfs_status.c
index 8f6833bd27..30927e881f 100644
--- a/lustre/obdclass/lprocfs_status.c
+++ b/lustre/obdclass/lprocfs_status.c
@@ -1325,8 +1325,10 @@ int lprocfs_exp_setup(struct obd_export *exp, lnet_nid_t nid, int *newnid)
         if (rc)
                 CWARN("Error adding the uuid file\n");
 
-        /* this used only for destroy and because not need locking */
+        /* protect competitive add to list, not need locking on destroy */
+        spin_lock(&obd->nid_lock);
         list_add(&tmp->nid_list, &obd->obd_nid_stats);
+        spin_unlock(&obd->nid_lock);
 
         exp->exp_nid_stats = tmp;
         *newnid = 1;
-- 
GitLab