Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 46910
b: refs/heads/master
c: a6fa364
h: refs/heads/master
v: v3
  • Loading branch information
Kurt Hackel authored and Mark Fasheh committed Feb 7, 2007
1 parent 7e40de6 commit 898fb7a
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 3 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: 28b72d9c92ed43e01e4094f57bcad1814b002779
refs/heads/master: a6fa36402aba96362311318200d710ea1719e59b
5 changes: 4 additions & 1 deletion trunk/fs/ocfs2/dlm/dlmconvert.c
Original file line number Diff line number Diff line change
Expand Up @@ -428,7 +428,7 @@ int dlm_convert_lock_handler(struct o2net_msg *msg, u32 len, void *data)
struct dlm_lockstatus *lksb;
enum dlm_status status = DLM_NORMAL;
u32 flags;
int call_ast = 0, kick_thread = 0, ast_reserved = 0;
int call_ast = 0, kick_thread = 0, ast_reserved = 0, wake = 0;

if (!dlm_grab(dlm)) {
dlm_error(DLM_REJECTED);
Expand Down Expand Up @@ -524,8 +524,11 @@ int dlm_convert_lock_handler(struct o2net_msg *msg, u32 len, void *data)
cnv->requested_type,
&call_ast, &kick_thread);
res->state &= ~DLM_LOCK_RES_IN_PROGRESS;
wake = 1;
}
spin_unlock(&res->spinlock);
if (wake)
wake_up(&res->wq);

if (status != DLM_NORMAL) {
if (status != DLM_NOTQUEUED)
Expand Down
14 changes: 13 additions & 1 deletion trunk/fs/ocfs2/dlm/dlmmaster.c
Original file line number Diff line number Diff line change
Expand Up @@ -1967,20 +1967,24 @@ int dlm_assert_master_handler(struct o2net_msg *msg, u32 len, void *data)
spin_unlock(&mle->spinlock);

if (res) {
int wake = 0;
spin_lock(&res->spinlock);
if (mle->type == DLM_MLE_MIGRATION) {
mlog(0, "finishing off migration of lockres %.*s, "
"from %u to %u\n",
res->lockname.len, res->lockname.name,
dlm->node_num, mle->new_master);
res->state &= ~DLM_LOCK_RES_MIGRATING;
wake = 1;
dlm_change_lockres_owner(dlm, res, mle->new_master);
BUG_ON(res->state & DLM_LOCK_RES_DIRTY);
} else {
dlm_change_lockres_owner(dlm, res, mle->master);
}
spin_unlock(&res->spinlock);
have_lockres_ref = 1;
if (wake)
wake_up(&res->wq);
}

/* master is known, detach if not already detached.
Expand Down Expand Up @@ -2342,7 +2346,7 @@ static int dlm_migrate_lockres(struct dlm_ctxt *dlm,
struct list_head *queue, *iter;
int i;
struct dlm_lock *lock;
int empty = 1;
int empty = 1, wake = 0;

if (!dlm_grab(dlm))
return -EINVAL;
Expand Down Expand Up @@ -2467,6 +2471,7 @@ static int dlm_migrate_lockres(struct dlm_ctxt *dlm,
res->lockname.name, target);
spin_lock(&res->spinlock);
res->state &= ~DLM_LOCK_RES_MIGRATING;
wake = 1;
spin_unlock(&res->spinlock);
ret = -EINVAL;
}
Expand Down Expand Up @@ -2525,6 +2530,7 @@ static int dlm_migrate_lockres(struct dlm_ctxt *dlm,
dlm_put_mle_inuse(mle);
spin_lock(&res->spinlock);
res->state &= ~DLM_LOCK_RES_MIGRATING;
wake = 1;
spin_unlock(&res->spinlock);
goto leave;
}
Expand Down Expand Up @@ -2567,6 +2573,7 @@ static int dlm_migrate_lockres(struct dlm_ctxt *dlm,
dlm_put_mle_inuse(mle);
spin_lock(&res->spinlock);
res->state &= ~DLM_LOCK_RES_MIGRATING;
wake = 1;
spin_unlock(&res->spinlock);
goto leave;
}
Expand Down Expand Up @@ -2595,6 +2602,11 @@ static int dlm_migrate_lockres(struct dlm_ctxt *dlm,
if (ret < 0)
dlm_kick_thread(dlm, res);

/* wake up waiters if the MIGRATING flag got set
* but migration failed */
if (wake)
wake_up(&res->wq);

/* TODO: cleanup */
if (mres)
free_page((unsigned long)mres);
Expand Down
1 change: 1 addition & 0 deletions trunk/fs/ocfs2/dlm/dlmrecovery.c
Original file line number Diff line number Diff line change
Expand Up @@ -1420,6 +1420,7 @@ int dlm_mig_lockres_handler(struct o2net_msg *msg, u32 len, void *data)
spin_lock(&res->spinlock);
res->state &= ~DLM_LOCK_RES_IN_PROGRESS;
spin_unlock(&res->spinlock);
wake_up(&res->wq);

/* add an extra ref for just-allocated lockres
* otherwise the lockres will be purged immediately */
Expand Down

0 comments on commit 898fb7a

Please sign in to comment.