diff options
-rw-r--r-- | fs/ocfs2/dlm/dlmlock.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/fs/ocfs2/dlm/dlmlock.c b/fs/ocfs2/dlm/dlmlock.c index 57576208b79c..675123c30852 100644 --- a/fs/ocfs2/dlm/dlmlock.c +++ b/fs/ocfs2/dlm/dlmlock.c | |||
@@ -201,6 +201,7 @@ static enum dlm_status dlmlock_remote(struct dlm_ctxt *dlm, | |||
201 | struct dlm_lock *lock, int flags) | 201 | struct dlm_lock *lock, int flags) |
202 | { | 202 | { |
203 | enum dlm_status status = DLM_DENIED; | 203 | enum dlm_status status = DLM_DENIED; |
204 | int lockres_changed = 1; | ||
204 | 205 | ||
205 | mlog_entry("type=%d\n", lock->ml.type); | 206 | mlog_entry("type=%d\n", lock->ml.type); |
206 | mlog(0, "lockres %.*s, flags = 0x%x\n", res->lockname.len, | 207 | 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, | |||
230 | dlm_error(status); | 231 | dlm_error(status); |
231 | dlm_revert_pending_lock(res, lock); | 232 | dlm_revert_pending_lock(res, lock); |
232 | dlm_lock_put(lock); | 233 | dlm_lock_put(lock); |
234 | /* do NOT call calc_usage, as this would unhash the remote | ||
235 | * lockres before we ever get to use it. treat as if we | ||
236 | * never made any change to the lockres. */ | ||
237 | lockres_changed = 0; | ||
233 | } else if (dlm_is_recovery_lock(res->lockname.name, | 238 | } else if (dlm_is_recovery_lock(res->lockname.name, |
234 | res->lockname.len)) { | 239 | res->lockname.len)) { |
235 | /* special case for the $RECOVERY lock. | 240 | /* special case for the $RECOVERY lock. |
@@ -243,7 +248,8 @@ static enum dlm_status dlmlock_remote(struct dlm_ctxt *dlm, | |||
243 | } | 248 | } |
244 | spin_unlock(&res->spinlock); | 249 | spin_unlock(&res->spinlock); |
245 | 250 | ||
246 | dlm_lockres_calc_usage(dlm, res); | 251 | if (lockres_changed) |
252 | dlm_lockres_calc_usage(dlm, res); | ||
247 | 253 | ||
248 | wake_up(&res->wq); | 254 | wake_up(&res->wq); |
249 | return status; | 255 | return status; |