diff options
Diffstat (limited to 'fs/ocfs2/dlm/dlmlock.c')
-rw-r--r-- | fs/ocfs2/dlm/dlmlock.c | 33 |
1 files changed, 23 insertions, 10 deletions
diff --git a/fs/ocfs2/dlm/dlmlock.c b/fs/ocfs2/dlm/dlmlock.c index 0ff934874942..20b38dc18736 100644 --- a/fs/ocfs2/dlm/dlmlock.c +++ b/fs/ocfs2/dlm/dlmlock.c | |||
@@ -227,7 +227,16 @@ static enum dlm_status dlmlock_remote(struct dlm_ctxt *dlm, | |||
227 | res->state &= ~DLM_LOCK_RES_IN_PROGRESS; | 227 | res->state &= ~DLM_LOCK_RES_IN_PROGRESS; |
228 | lock->lock_pending = 0; | 228 | lock->lock_pending = 0; |
229 | if (status != DLM_NORMAL) { | 229 | if (status != DLM_NORMAL) { |
230 | if (status != DLM_NOTQUEUED) { | 230 | if (status == DLM_RECOVERING && |
231 | dlm_is_recovery_lock(res->lockname.name, | ||
232 | res->lockname.len)) { | ||
233 | /* recovery lock was mastered by dead node. | ||
234 | * we need to have calc_usage shoot down this | ||
235 | * lockres and completely remaster it. */ | ||
236 | mlog(0, "%s: recovery lock was owned by " | ||
237 | "dead node %u, remaster it now.\n", | ||
238 | dlm->name, res->owner); | ||
239 | } else if (status != DLM_NOTQUEUED) { | ||
231 | /* | 240 | /* |
232 | * DO NOT call calc_usage, as this would unhash | 241 | * DO NOT call calc_usage, as this would unhash |
233 | * the remote lockres before we ever get to use | 242 | * the remote lockres before we ever get to use |
@@ -691,18 +700,22 @@ retry_lock: | |||
691 | msleep(100); | 700 | msleep(100); |
692 | /* no waiting for dlm_reco_thread */ | 701 | /* no waiting for dlm_reco_thread */ |
693 | if (recovery) { | 702 | if (recovery) { |
694 | if (status == DLM_RECOVERING) { | 703 | if (status != DLM_RECOVERING) |
695 | mlog(0, "%s: got RECOVERING " | 704 | goto retry_lock; |
696 | "for $REOCVERY lock, master " | 705 | |
697 | "was %u\n", dlm->name, | 706 | mlog(0, "%s: got RECOVERING " |
698 | res->owner); | 707 | "for $RECOVERY lock, master " |
699 | dlm_wait_for_node_death(dlm, res->owner, | 708 | "was %u\n", dlm->name, |
700 | DLM_NODE_DEATH_WAIT_MAX); | 709 | res->owner); |
701 | } | 710 | /* wait to see the node go down, then |
711 | * drop down and allow the lockres to | ||
712 | * get cleaned up. need to remaster. */ | ||
713 | dlm_wait_for_node_death(dlm, res->owner, | ||
714 | DLM_NODE_DEATH_WAIT_MAX); | ||
702 | } else { | 715 | } else { |
703 | dlm_wait_for_recovery(dlm); | 716 | dlm_wait_for_recovery(dlm); |
717 | goto retry_lock; | ||
704 | } | 718 | } |
705 | goto retry_lock; | ||
706 | } | 719 | } |
707 | 720 | ||
708 | if (status != DLM_NORMAL) { | 721 | if (status != DLM_NORMAL) { |