cluster-devel.redhat.com archive mirror
 help / color / mirror / Atom feed
* [Cluster-devel] [PATCH 13/17] dlm: fix _can_be_granted() for lock at the head of covert queue.
@ 2017-08-09  5:51 tsutomu.owa
  2017-08-09 16:41 ` David Teigland
  0 siblings, 1 reply; 4+ messages in thread
From: tsutomu.owa @ 2017-08-09  5:51 UTC (permalink / raw)
  To: cluster-devel.redhat.com

If there is a lock resource conflict on multiple nodes, the lock on
convert queue may not be granted forever.

EX.)
grant queue:
    node0 grmode NL / rqmode IV
    node1 grmode NL / rqmode IV

convert queue:
    node2 grmode NL / rqmode EX
    node3 grmode PR / rqmode EX

wait queue:
    node4 grmode IV / rqmode PR
    node5 grmode IV / rqmode PR

When the lock conversion (node PR -> NL) of node 0 is completed, the lock
of node 2 should be grantable. However, __can_be_granted() returns 0
because the grmode of the lock on node 3 in convert queue is PR.

When checking the lock at the head of convert queue, exclude
queue_conflict() targeting convert queue.

Signed-off-by: Tadashi Miyauchi <miyauchi@toshiba-tops.co.jp>
Signed-off-by: Tsutomu Owa <tsutomu.owa@toshiba.co.jp>
---
 fs/dlm/lock.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/fs/dlm/lock.c b/fs/dlm/lock.c
index 35502d4..dcdd26d 100644
--- a/fs/dlm/lock.c
+++ b/fs/dlm/lock.c
@@ -2336,7 +2336,8 @@ static int _can_be_granted(struct dlm_rsb *r, struct dlm_lkb *lkb, int now,
 	 * locks
 	 */
 
-	if (queue_conflict(&r->res_convertqueue, lkb))
+	if (!first_in_list(lkb, &r->res_convertqueue) &&
+	    queue_conflict(&r->res_convertqueue, lkb))
 		return 0;
 
 	/*
-- 
2.7.4






^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2017-08-17 23:40 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-08-09  5:51 [Cluster-devel] [PATCH 13/17] dlm: fix _can_be_granted() for lock at the head of covert queue tsutomu.owa
2017-08-09 16:41 ` David Teigland
2017-08-09 18:48   ` David Teigland
2017-08-17 23:40     ` tsutomu.owa

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).