dlm: fix QUECVT when convert queue is empty
authorDavid Teigland <teigland@redhat.com>
Wed, 4 Apr 2012 14:49:15 +0000 (09:49 -0500)
committerDavid Teigland <teigland@redhat.com>
Mon, 23 Apr 2012 16:30:59 +0000 (11:30 -0500)
The QUECVT flag should not prevent conversions from
being granted immediately when the convert queue is
empty.

Signed-off-by: David Teigland <teigland@redhat.com>

fs/dlm/lock.c

index fa5c07d..4c58d4a 100644 (file)
@@ -1737,6 +1737,18 @@ static int _can_be_granted(struct dlm_rsb *r, struct dlm_lkb *lkb, int now)
                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.
         */