]> git.ipfire.org Git - ipfire-2.x.git/blame - src/patches/suse-2.6.27.39/patches.fixes/ocfs2-wakeup-the-downconvert-thread-after-a-success.patch
Imported linux-2.6.27.39 suse/xen patches.
[ipfire-2.x.git] / src / patches / suse-2.6.27.39 / patches.fixes / ocfs2-wakeup-the-downconvert-thread-after-a-success.patch
CommitLineData
2cb7cef9
BS
1From: Sunil Mushran <sunil.mushran@oracle.com>
2Date: Thu, 29 Jan 2009 17:12:31 -0800
3Subject: [PATCH] ocfs2: Wakeup the downconvert thread after a successful cancel convert
4Patch-mainline: 2.6.29
5
6When two nodes holding PR locks on a resource concurrently attempt to
7upconvert the locks to EX, the master sends a BAST to one of the nodes. This
8message tells that node to first cancel convert the upconvert request,
9followed by downconvert to a NL. Only when this lock is downconverted to NL,
10can the master upconvert the first node's lock to EX.
11
12While the fs was doing the cancel convert, it was forgetting to wake up the
13dc thread after a successful cancel, leading to a deadlock.
14
15Reported-and-Tested-by: David Teigland <teigland@redhat.com>
16Signed-off-by: Sunil Mushran <sunil.mushran@oracle.com>
17Signed-off-by: Mark Fasheh <mfasheh@suse.com>
18---
19 fs/ocfs2/dlmglue.c | 4 ++++
20 1 file changed, 4 insertions(+)
21
22--- a/fs/ocfs2/dlmglue.c
23+++ b/fs/ocfs2/dlmglue.c
24@@ -2866,6 +2866,10 @@ static void ocfs2_unlock_ast(void *opaqu
25 case OCFS2_UNLOCK_CANCEL_CONVERT:
26 mlog(0, "Cancel convert success for %s\n", lockres->l_name);
27 lockres->l_action = OCFS2_AST_INVALID;
28+ /* Downconvert thread may have requeued this lock, we
29+ * need to wake it. */
30+ if (lockres->l_flags & OCFS2_LOCK_BLOCKED)
31+ ocfs2_wake_downconvert_thread(ocfs2_get_lockres_osb(lockres));
32 break;
33 case OCFS2_UNLOCK_DROP_LOCK:
34 lockres->l_level = DLM_LOCK_IV;