From 91792b969b5f957bdbeca965e4f4916d52af577c Mon Sep 17 00:00:00 2001 From: "Alexander.Zarochentsev" Date: Thu, 10 Jun 2010 14:35:04 +0400 Subject: [PATCH] b=22598 Make COS lock inode bits aware a=oleg.drokin i=tappro i=robert.read --- lustre/ldlm/ldlm_inodebits.c | 21 ++++++--------------- 1 file changed, 6 insertions(+), 15 deletions(-) diff --git a/lustre/ldlm/ldlm_inodebits.c b/lustre/ldlm/ldlm_inodebits.c index be9a073..406d059 100644 --- a/lustre/ldlm/ldlm_inodebits.c +++ b/lustre/ldlm/ldlm_inodebits.c @@ -87,21 +87,6 @@ ldlm_inodebits_compat_queue(cfs_list_t *queue, struct ldlm_lock *req, continue; } - if (lock->l_req_mode == LCK_COS) { - if (lock->l_client_cookie == req->l_client_cookie) { - tmp = mode_tail; - } else { - tmp = mode_tail; - if (!work_list) - RETURN(0); - compat = 0; - if (lock->l_blocking_ast) - ldlm_add_ast_work_item(lock, req, - work_list); - } - continue; - } - for (;;) { cfs_list_t *head; @@ -112,6 +97,11 @@ ldlm_inodebits_compat_queue(cfs_list_t *queue, struct ldlm_lock *req, /* locks with bits overlapped are conflicting locks */ if (lock->l_policy_data.l_inodebits.bits & req_bits) { + /* COS lock from the same client is + not conflicting */ + if (lock->l_req_mode == LCK_COS && + lock->l_client_cookie == req->l_client_cookie) + goto not_conflicting; /* conflicting policy */ if (!work_list) RETURN(0); @@ -130,6 +120,7 @@ ldlm_inodebits_compat_queue(cfs_list_t *queue, struct ldlm_lock *req, ldlm_add_ast_work_item(lock, req, work_list); } + not_conflicting: if (tmp == mode_tail) break; -- 1.8.3.1