Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 276177
b: refs/heads/master
c: a2c0cc1
h: refs/heads/master
i:
  276175: 367dacc
v: v3
  • Loading branch information
Sunil Mushran committed Jul 24, 2011
1 parent 79535a6 commit 5e74800
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 11 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: ff0a522e7db79625aa27a433467eb94c5e255718
refs/heads/master: a2c0cc1579176bd0808ef7deea456767dfa80217
18 changes: 8 additions & 10 deletions trunk/fs/ocfs2/dlm/dlmlock.c
Original file line number Diff line number Diff line change
Expand Up @@ -227,10 +227,16 @@ static enum dlm_status dlmlock_remote(struct dlm_ctxt *dlm,
lock->ml.type, res->lockname.len,
res->lockname.name, flags);

/*
* Wait if resource is getting recovered, remastered, etc.
* If the resource was remastered and new owner is self, then exit.
*/
spin_lock(&res->spinlock);

/* will exit this call with spinlock held */
__dlm_wait_on_lockres(res);
if (res->owner == dlm->node_num) {
spin_unlock(&res->spinlock);
return DLM_RECOVERING;
}
res->state |= DLM_LOCK_RES_IN_PROGRESS;

/* add lock to local (secondary) queue */
Expand Down Expand Up @@ -710,18 +716,10 @@ enum dlm_status dlmlock(struct dlm_ctxt *dlm, int mode,

if (status == DLM_RECOVERING || status == DLM_MIGRATING ||
status == DLM_FORWARD) {
mlog(0, "retrying lock with migration/"
"recovery/in progress\n");
msleep(100);
/* no waiting for dlm_reco_thread */
if (recovery) {
if (status != DLM_RECOVERING)
goto retry_lock;

mlog(0, "%s: got RECOVERING "
"for $RECOVERY lock, master "
"was %u\n", dlm->name,
res->owner);
/* wait to see the node go down, then
* drop down and allow the lockres to
* get cleaned up. need to remaster. */
Expand Down

0 comments on commit 5e74800

Please sign in to comment.