[Ocfs2-devel] [PATCH 08/15] ocfs2: fix wake_up in unlock_ast

Sunil Mushran sunil.mushran at oracle.com
Tue Jan 13 17:47:13 PST 2009


From: David Teigland <teigland at redhat.com>

Mainline commit 07f9eebcdfaeefc8f807fa1bcce1d7c3ae6661b1

In ocfs2_unlock_ast(), call wake_up() on lockres before releasing
the spin lock on it.  As soon as the spin lock is released, the
lockres can be freed.

Signed-off-by: David Teigland <teigland at redhat.com>
Signed-off-by: Mark Fasheh <mfasheh at suse.com>
---
 fs/ocfs2/dlmglue.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/fs/ocfs2/dlmglue.c b/fs/ocfs2/dlmglue.c
index 7781ef1..fce142b 100644
--- a/fs/ocfs2/dlmglue.c
+++ b/fs/ocfs2/dlmglue.c
@@ -2756,9 +2756,8 @@ static void ocfs2_unlock_ast(void *opaque, enum dlm_status status)
 	lockres_clear_flags(lockres, OCFS2_LOCK_BUSY);
 complete_unlock:
 	lockres->l_unlock_action = OCFS2_UNLOCK_INVALID;
-	spin_unlock_irqrestore(&lockres->l_lock, flags);
-
 	wake_up(&lockres->l_event);
+	spin_unlock_irqrestore(&lockres->l_lock, flags);
 
 	mlog_exit_void();
 }
-- 
1.5.6.3




More information about the Ocfs2-devel mailing list