From 20d24122dd9dfec16eae2a27eb9159c39de6a24a Mon Sep 17 00:00:00 2001
From: green <green>
Date: Wed, 19 Mar 2008 06:40:28 +0000
Subject: [PATCH] b=14379 r=vitaly,adilger

Always walk entire list of granted locks on match for now.
---
 lustre/ChangeLog        | 6 ++++++
 lustre/ldlm/ldlm_lock.c | 2 +-
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/lustre/ChangeLog b/lustre/ChangeLog
index 08463bc8bb..492499ad4c 100644
--- a/lustre/ChangeLog
+++ b/lustre/ChangeLog
@@ -834,6 +834,12 @@ Bugzilla   : 15033
 Description: build for x2 fails
 Details    : fix compile issue on Cray systems.
 
+Severity   : normal
+Bugzilla   : 14379
+Description: Properly match for duplicate locks
+Details    : Due to different lock order from skiplists code, we need to
+             traverse entire list for now
+
 --------------------------------------------------------------------------------
 
 2007-08-10         Cluster File Systems, Inc. <info@clusterfs.com>
diff --git a/lustre/ldlm/ldlm_lock.c b/lustre/ldlm/ldlm_lock.c
index 825dfb89e0..6f7f5cf814 100644
--- a/lustre/ldlm/ldlm_lock.c
+++ b/lustre/ldlm/ldlm_lock.c
@@ -911,7 +911,7 @@ static struct ldlm_lock *search_queue(struct list_head *queue,
                 lock = list_entry(tmp, struct ldlm_lock, l_res_link);
 
                 if (lock == old_lock)
-                        break;
+                        continue;
 
                 /* llite sometimes wants to match locks that will be
                  * canceled when their users drop, but we allow it to match
-- 
GitLab