From 12fa816bb372cdd30750fbce90d46f18787698f1 Mon Sep 17 00:00:00 2001
From: lsy <lsy>
Date: Mon, 30 Apr 2007 08:58:43 +0000
Subject: [PATCH] b=11315 i=adilger

unmatched spin_lock/unlock of imp_lock might cause deadlock.
---
 lustre/ptlrpc/import.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/lustre/ptlrpc/import.c b/lustre/ptlrpc/import.c
index fe597070f8..9104a6dbca 100644
--- a/lustre/ptlrpc/import.c
+++ b/lustre/ptlrpc/import.c
@@ -519,6 +519,7 @@ static int ptlrpc_connect_interpret(struct ptlrpc_request *request,
                 spin_unlock(&imp->imp_lock);
                 RETURN(0);
         }
+        spin_unlock(&imp->imp_lock);
 
         if (rc)
                 GOTO(out, rc);
@@ -528,6 +529,7 @@ static int ptlrpc_connect_interpret(struct ptlrpc_request *request,
         msg_flags = lustre_msg_get_op_flags(request->rq_repmsg);
 
         /* All imports are pingable */
+        spin_lock(&imp->imp_lock);
         imp->imp_pingable = 1;
 
         if (aa->pcaa_initial_connect) {
-- 
GitLab