ocfs2: Fix setting of OCFS2_LOCK_BLOCKED during bast
authorWengang Wang <wen.gang.wang@oracle.com>
Thu, 21 Jan 2010 18:50:02 +0000 (10:50 -0800)
committerJoel Becker <joel.becker@oracle.com>
Wed, 3 Feb 2010 07:50:55 +0000 (23:50 -0800)
During bast, set the OCFS2_LOCK_BLOCKED flag only if the lock needs to
downconverted.

Signed-off-by: Wengang Wang <wen.gang.wang@oracle.com>
Acked-by: Sunil Mushran <sunil.mushran@oracle.com>
Acked-by: Mark Fasheh <mfasheh@suse.com>
Signed-off-by: Joel Becker <joel.becker@oracle.com>
fs/ocfs2/dlmglue.c

index 172f4c6ce1bebfbdef854120ebcf186924143d13..0cdf63042b76de1b89fb9fd01ba735322717acc5 100644 (file)
@@ -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;
 }