Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 46907
b: refs/heads/master
c: 1cd04db
h: refs/heads/master
i:
  46905: 341a72d
  46903: 118830b
v: v3
  • Loading branch information
Kurt Hackel authored and Mark Fasheh committed Feb 7, 2007
1 parent 36abe3f commit 43d2668
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 17 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: e17e75ecb86b8ce9b51b219b5348517561031f80
refs/heads/master: 1cd04dbe3364be71b93e3aaf4545daa1e261aaa1
36 changes: 20 additions & 16 deletions trunk/fs/ocfs2/dlm/dlmmaster.c
Original file line number Diff line number Diff line change
Expand Up @@ -1507,10 +1507,11 @@ int dlm_master_request_handler(struct o2net_msg *msg, u32 len, void *data)

/* take care of the easy cases up front */
spin_lock(&res->spinlock);
if (res->state & DLM_LOCK_RES_RECOVERING) {
if (res->state & (DLM_LOCK_RES_RECOVERING|
DLM_LOCK_RES_MIGRATING)) {
spin_unlock(&res->spinlock);
mlog(0, "returning DLM_MASTER_RESP_ERROR since res is "
"being recovered\n");
"being recovered/migrated\n");
response = DLM_MASTER_RESP_ERROR;
if (mle)
kmem_cache_free(dlm_mle_cache, mle);
Expand Down Expand Up @@ -2493,6 +2494,9 @@ static int dlm_migrate_lockres(struct dlm_ctxt *dlm,
* the lockres
*/

/* now that remote nodes are spinning on the MIGRATING flag,
* ensure that all assert_master work is flushed. */
flush_workqueue(dlm->dlm_worker);

/* get an extra reference on the mle.
* otherwise the assert_master from the new
Expand Down Expand Up @@ -2547,28 +2551,28 @@ static int dlm_migrate_lockres(struct dlm_ctxt *dlm,
res->owner == target)
break;

mlog(0, "timed out during migration\n");
mlog(0, "%s:%.*s: timed out during migration\n",
dlm->name, res->lockname.len, res->lockname.name);
/* avoid hang during shutdown when migrating lockres
* to a node which also goes down */
if (dlm_is_node_dead(dlm, target)) {
mlog(0, "%s:%.*s: expected migration "
"target %u is no longer up, restarting\n",
dlm->name, res->lockname.len,
res->lockname.name, target);
ret = -ERESTARTSYS;
ret = -EINVAL;
/* migration failed, detach and clean up mle */
dlm_mle_detach_hb_events(dlm, mle);
dlm_put_mle(mle);
dlm_put_mle_inuse(mle);
spin_lock(&res->spinlock);
res->state &= ~DLM_LOCK_RES_MIGRATING;
spin_unlock(&res->spinlock);
goto leave;
}
}
if (ret == -ERESTARTSYS) {
/* migration failed, detach and clean up mle */
dlm_mle_detach_hb_events(dlm, mle);
dlm_put_mle(mle);
dlm_put_mle_inuse(mle);
spin_lock(&res->spinlock);
res->state &= ~DLM_LOCK_RES_MIGRATING;
spin_unlock(&res->spinlock);
goto leave;
}
/* TODO: if node died: stop, clean up, return error */
} else
mlog(0, "%s:%.*s: caught signal during migration\n",
dlm->name, res->lockname.len, res->lockname.name);
}

/* all done, set the owner, clear the flag */
Expand Down

0 comments on commit 43d2668

Please sign in to comment.