From 36ea195cb3d070b5125bf044f168bb933437a64e Mon Sep 17 00:00:00 2001 From: Kurt Hackel Date: Mon, 1 May 2006 13:27:10 -0700 Subject: [PATCH] --- yaml --- r: 30691 b: refs/heads/master c: 2abaf97e62e51fdd09d5a46703b3b680f24bdd8b h: refs/heads/master i: 30689: 8b8379d03d888a8c7e69f741ad5a1b9f0426dadd 30687: 5b5eb0010e88d7c1fee1834052d4efba531a7b25 v: v3 --- [refs] | 2 +- trunk/fs/ocfs2/dlm/dlmlock.c | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/[refs] b/[refs] index 9ecc106b52bb..4658bbe1c8b8 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: aa087b84977173395c0e3a1e0c1773314958f277 +refs/heads/master: 2abaf97e62e51fdd09d5a46703b3b680f24bdd8b diff --git a/trunk/fs/ocfs2/dlm/dlmlock.c b/trunk/fs/ocfs2/dlm/dlmlock.c index 57576208b79c..675123c30852 100644 --- a/trunk/fs/ocfs2/dlm/dlmlock.c +++ b/trunk/fs/ocfs2/dlm/dlmlock.c @@ -201,6 +201,7 @@ static enum dlm_status dlmlock_remote(struct dlm_ctxt *dlm, struct dlm_lock *lock, int flags) { enum dlm_status status = DLM_DENIED; + int lockres_changed = 1; mlog_entry("type=%d\n", lock->ml.type); mlog(0, "lockres %.*s, flags = 0x%x\n", res->lockname.len, @@ -230,6 +231,10 @@ static enum dlm_status dlmlock_remote(struct dlm_ctxt *dlm, dlm_error(status); dlm_revert_pending_lock(res, lock); dlm_lock_put(lock); + /* do NOT call calc_usage, as this would unhash the remote + * lockres before we ever get to use it. treat as if we + * never made any change to the lockres. */ + lockres_changed = 0; } else if (dlm_is_recovery_lock(res->lockname.name, res->lockname.len)) { /* special case for the $RECOVERY lock. @@ -243,7 +248,8 @@ static enum dlm_status dlmlock_remote(struct dlm_ctxt *dlm, } spin_unlock(&res->spinlock); - dlm_lockres_calc_usage(dlm, res); + if (lockres_changed) + dlm_lockres_calc_usage(dlm, res); wake_up(&res->wq); return status;