From: David Teigland Date: Wed, 4 Apr 2012 14:49:15 +0000 (-0500) Subject: dlm: fix QUECVT when convert queue is empty X-Git-Tag: firefly_0821_release~3680^2~3015^2 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=53ad1c980d4fb450722a575ca17c188808939340;p=firefly-linux-kernel-4.4.55.git dlm: fix QUECVT when convert queue is empty The QUECVT flag should not prevent conversions from being granted immediately when the convert queue is empty. Signed-off-by: David Teigland --- diff --git a/fs/dlm/lock.c b/fs/dlm/lock.c index fa5c07d51dcc..4c58d4a3adc4 100644 --- a/fs/dlm/lock.c +++ b/fs/dlm/lock.c @@ -1736,6 +1736,18 @@ static int _can_be_granted(struct dlm_rsb *r, struct dlm_lkb *lkb, int now) if (now && conv && !(lkb->lkb_exflags & DLM_LKF_QUECVT)) return 1; + /* + * Even if the convert is compat with all granted locks, + * QUECVT forces it behind other locks on the convert queue. + */ + + if (now && conv && (lkb->lkb_exflags & DLM_LKF_QUECVT)) { + if (list_empty(&r->res_convertqueue)) + return 1; + else + goto out; + } + /* * The NOORDER flag is set to avoid the standard vms rules on grant * order.