From 86c1c85304c119ffe6dc50bc5de2f6490bc27aa8 Mon Sep 17 00:00:00 2001
From: shadow <shadow>
Date: Thu, 17 May 2007 05:20:10 +0000
Subject: [PATCH] ptlrpc_check_set wrongly uses req->rq_lock for proctect add
 to imp_delayed_list, in this place should be used imp_lock. b=12477 i=alex
 i=eeb

---
 lustre/ChangeLog       | 7 +++++++
 lustre/ptlrpc/client.c | 4 ++--
 2 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/lustre/ChangeLog b/lustre/ChangeLog
index c698c0493e..a352b94977 100644
--- a/lustre/ChangeLog
+++ b/lustre/ChangeLog
@@ -115,6 +115,13 @@ Bugzilla   : 11658
 Description: log_commit_thread vs filter_destroy race leads to crash
 Details    : Take import reference before releasing llog record semaphore
 
+Severity   : normal
+Frequency  : rare
+Bugzilla   : 12477
+Description: Wrong request locking in request set processing
+Details    : ptlrpc_check_set wrongly uses req->rq_lock for proctect add to
+	     imp_delayed_list, in this place should be used imp_lock.
+
 --------------------------------------------------------------------------------
 
 2007-05-03  Cluster File Systems, Inc. <info@clusterfs.com>
diff --git a/lustre/ptlrpc/client.c b/lustre/ptlrpc/client.c
index 39a77aff77..b1ba7df821 100644
--- a/lustre/ptlrpc/client.c
+++ b/lustre/ptlrpc/client.c
@@ -872,10 +872,10 @@ int ptlrpc_check_set(struct ptlrpc_request_set *set)
                                 /* Add this req to the delayed list so
                                    it can be errored if the import is
                                    evicted after recovery. */
-                                spin_lock(&req->rq_lock);
+                                spin_lock(&imp->imp_lock);
                                 list_add_tail(&req->rq_list,
                                               &imp->imp_delayed_list);
-                                spin_unlock(&req->rq_lock);
+                                spin_unlock(&imp->imp_lock);
                                 continue;
                         }
 
-- 
GitLab