From 55f21b84bb52a4155f13f45a51ccaf2c9f029e65 Mon Sep 17 00:00:00 2001 From: Mark Fasheh Date: Fri, 5 Oct 2007 12:09:05 -0700 Subject: [PATCH] --- yaml --- r: 73296 b: refs/heads/master c: 019d1b2247c6898589560c6f3b3e7ec280b0010a h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/fs/ocfs2/dlmglue.c | 23 +++++++++-------------- 2 files changed, 10 insertions(+), 15 deletions(-) diff --git a/[refs] b/[refs] index ebd38cc8b385..b8fba98116bb 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 3cf0c507dd28de0e1a4c24304d806e6b3976f0f5 +refs/heads/master: 019d1b2247c6898589560c6f3b3e7ec280b0010a diff --git a/trunk/fs/ocfs2/dlmglue.c b/trunk/fs/ocfs2/dlmglue.c index ef09fd20f3a5..4e97dcceaf8f 100644 --- a/trunk/fs/ocfs2/dlmglue.c +++ b/trunk/fs/ocfs2/dlmglue.c @@ -980,18 +980,6 @@ static int ocfs2_cluster_lock(struct ocfs2_super *osb, goto unlock; } - if (!(lockres->l_flags & OCFS2_LOCK_ATTACHED)) { - /* lock has not been created yet. */ - spin_unlock_irqrestore(&lockres->l_lock, flags); - - ret = ocfs2_lock_create(osb, lockres, LKM_NLMODE, 0); - if (ret < 0) { - mlog_errno(ret); - goto out; - } - goto again; - } - if (lockres->l_flags & OCFS2_LOCK_BLOCKED && !ocfs2_may_continue_on_blocked_lock(lockres, level)) { /* is the lock is currently blocked on behalf of @@ -1006,7 +994,14 @@ static int ocfs2_cluster_lock(struct ocfs2_super *osb, mlog(ML_ERROR, "lockres %s has action %u pending\n", lockres->l_name, lockres->l_action); - lockres->l_action = OCFS2_AST_CONVERT; + if (!(lockres->l_flags & OCFS2_LOCK_ATTACHED)) { + lockres->l_action = OCFS2_AST_ATTACH; + lkm_flags &= ~LKM_CONVERT; + } else { + lockres->l_action = OCFS2_AST_CONVERT; + lkm_flags |= LKM_CONVERT; + } + lockres->l_requested = level; lockres_or_flags(lockres, OCFS2_LOCK_BUSY); spin_unlock_irqrestore(&lockres->l_lock, flags); @@ -1021,7 +1016,7 @@ static int ocfs2_cluster_lock(struct ocfs2_super *osb, status = dlmlock(osb->dlm, level, &lockres->l_lksb, - lkm_flags|LKM_CONVERT, + lkm_flags, lockres->l_name, OCFS2_LOCK_ID_MAX_LEN - 1, ocfs2_locking_ast,