From 58ef2320402c65676128e7e61e6201d04385be18 Mon Sep 17 00:00:00 2001
From: bobijam <bobijam>
Date: Wed, 30 Apr 2008 01:50:54 +0000
Subject: [PATCH] Branch HEAD b=14995 i=wangdi, rread

send activate event only for evicted imports.
---
 lustre/ptlrpc/import.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/lustre/ptlrpc/import.c b/lustre/ptlrpc/import.c
index aba05cfcf2..eb4b5fa606 100644
--- a/lustre/ptlrpc/import.c
+++ b/lustre/ptlrpc/import.c
@@ -644,7 +644,14 @@ static int ptlrpc_connect_interpret(struct ptlrpc_request *request,
                                 *lustre_msg_get_handle(request->rq_repmsg);
 
                 IMPORT_SET_STATE(imp, LUSTRE_IMP_FULL);
-                ptlrpc_activate_import(imp);
+                spin_lock(&imp->imp_lock);
+                if (imp->imp_invalid) {
+                        spin_unlock(&imp->imp_lock);
+                        ptlrpc_activate_import(imp);
+                } else {
+                        spin_unlock(&imp->imp_lock);
+                }
+
                 GOTO(finish, rc = 0);
         } else {
                 spin_unlock(&imp->imp_lock);
-- 
GitLab