]> git.ipfire.org Git - ipfire-2.x.git/blame - src/patches/suse-2.6.27.39/patches.suse/dlm-ignore-cancel-on-granted-lock.patch
Imported linux-2.6.27.39 suse/xen patches.
[ipfire-2.x.git] / src / patches / suse-2.6.27.39 / patches.suse / dlm-ignore-cancel-on-granted-lock.patch
CommitLineData
2cb7cef9
BS
1From: David Teigland <teigland@redhat.com>
2commit a536e38125fe5da8ed49690f30c30a8f651cf1f5
3Author: David Teigland <teigland@redhat.com>
4Date: Fri Feb 27 15:23:28 2009 -0600
5Subject: dlm: ignore cancel on granted lock
6
7 Return immediately from dlm_unlock(CANCEL) if the lock is
8 granted and not being converted; there's nothing to cancel.
9
10Signed-off-by: David Teigland <teigland@redhat.com>
11Signed-off-by: Coly Li <coly.li@suse.de>
12
13diff --git a/fs/dlm/lock.c b/fs/dlm/lock.c
14index 8cb9204..205ec95 100644
15--- a/fs/dlm/lock.c
16+++ b/fs/dlm/lock.c
17@@ -2186,6 +2186,13 @@ static int validate_unlock_args(struct dlm_lkb *lkb, struct dlm_args *args)
18 goto out;
19 }
20
21+ /* there's nothing to cancel */
22+ if (lkb->lkb_status == DLM_LKSTS_GRANTED &&
23+ !lkb->lkb_wait_type) {
24+ rv = -EBUSY;
25+ goto out;
26+ }
27+
28 switch (lkb->lkb_wait_type) {
29 case DLM_MSG_LOOKUP:
30 case DLM_MSG_REQUEST: