From 2c08b7a17f382a6467ebbaac40d2b41be425de60 Mon Sep 17 00:00:00 2001
From: shadow <shadow>
Date: Tue, 19 Aug 2008 11:13:20 +0000
Subject: [PATCH] avoid ASSERTION(client_stat->nid_exp_ref_count == 0)
 failed:count 1 Branch HEAD b=15139 i=rread i=tappro

---
 lustre/mgs/mgs_handler.c  | 2 ++
 lustre/obdfilter/filter.c | 3 ++-
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/lustre/mgs/mgs_handler.c b/lustre/mgs/mgs_handler.c
index 7673c43f8c..afb32553ed 100644
--- a/lustre/mgs/mgs_handler.c
+++ b/lustre/mgs/mgs_handler.c
@@ -131,6 +131,8 @@ static int mgs_disconnect(struct obd_export *exp)
         rc = class_disconnect(exp);
         ldlm_cancel_locks_for_export(exp);
 
+        lprocfs_exp_cleanup(exp);
+
         /* complete all outstanding replies */
         spin_lock(&exp->exp_lock);
         while (!list_empty(&exp->exp_outstanding_replies)) {
diff --git a/lustre/obdfilter/filter.c b/lustre/obdfilter/filter.c
index 0d138e1316..3cac141c08 100644
--- a/lustre/obdfilter/filter.c
+++ b/lustre/obdfilter/filter.c
@@ -2882,7 +2882,6 @@ static int filter_destroy_export(struct obd_export *exp)
         if (obd_uuid_equals(&exp->exp_client_uuid, &exp->exp_obd->obd_uuid))
                 RETURN(0);
 
-        lprocfs_exp_cleanup(exp);
 
         if (exp->exp_obd->obd_replayable)
                 filter_client_free(exp);
@@ -2971,6 +2970,8 @@ static int filter_disconnect(struct obd_export *exp)
 
         fsfilt_sync(obd, obd->u.obt.obt_sb);
 
+        lprocfs_exp_cleanup(exp);
+
         /* flush any remaining cancel messages out to the target */
         filter_sync_llogs(obd, exp);
         class_export_put(exp);
-- 
GitLab