Whamcloud - gitweb
Branch b1_6
authorbobijam <bobijam>
Wed, 5 Mar 2008 07:24:49 +0000 (07:24 +0000)
committerbobijam <bobijam>
Wed, 5 Mar 2008 07:24:49 +0000 (07:24 +0000)
b=14873
i=johann
i=shadow

protect competitive adding to obd->obd_nid_stats.

lustre/obdclass/lprocfs_status.c

index 8f6833b..30927e8 100644 (file)
@@ -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;