All of lore.kernel.org
 help / color / mirror / Atom feed
* [Ocfs2-devel] [PATCH] ocfs2: set OCFS2_LOCK_BLOCKED properly
@ 2010-01-05 17:05 Wengang Wang
  2010-01-05 17:50 ` Sunil Mushran
  0 siblings, 1 reply; 6+ messages in thread
From: Wengang Wang @ 2010-01-05 17:05 UTC (permalink / raw)
  To: ocfs2-devel

for most cases ocfs2_generic_handle_bast() return 1 meaning that some down-
converting work should be done. but when it return 0, the OCFS2_LOCK_BLOCKED is
set inproperly.
OCFS2_LOCK_BLOCKED is cleared in a down-convertion(dc) is done. if no dc is needed
any more(done by another lock request queued before this one), OCFS2_LOCK_BLOCKED
stays there unexpectly.

the fix is that setting that flag when dc(s) is really needed.

Signed-off-by: Wengang Wang <wen.gang.wang@oracle.com>
---
 fs/ocfs2/dlmglue.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/fs/ocfs2/dlmglue.c b/fs/ocfs2/dlmglue.c
index c5e4a49..e18eadf 100644
--- a/fs/ocfs2/dlmglue.c
+++ b/fs/ocfs2/dlmglue.c
@@ -907,8 +907,6 @@ static int ocfs2_generic_handle_bast(struct ocfs2_lock_res *lockres,
 
 	assert_spin_locked(&lockres->l_lock);
 
-	lockres_or_flags(lockres, OCFS2_LOCK_BLOCKED);
-
 	if (level > lockres->l_blocking) {
 		/* only schedule a downconvert if we haven't already scheduled
 		 * one that goes low enough to satisfy the level we're
@@ -921,6 +919,9 @@ static int ocfs2_generic_handle_bast(struct ocfs2_lock_res *lockres,
 		lockres->l_blocking = level;
 	}
 
+	if (needs_downconvert)
+		lockres_or_flags(lockres, OCFS2_LOCK_BLOCKED);
+		
 	mlog_exit(needs_downconvert);
 	return needs_downconvert;
 }
-- 
1.6.2.5

^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2010-01-07  2:50 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-01-05 17:05 [Ocfs2-devel] [PATCH] ocfs2: set OCFS2_LOCK_BLOCKED properly Wengang Wang
2010-01-05 17:50 ` Sunil Mushran
2010-01-07  1:03   ` Mark Fasheh
2010-01-07  1:46     ` Joel Becker
2010-01-07  2:10     ` Wengang Wang
2010-01-07  2:50       ` Mark Fasheh

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.