diff options
author | Kurt Hackel <kurt.hackel@oracle.com> | 2006-05-01 17:29:28 -0400 |
---|---|---|
committer | Mark Fasheh <mark.fasheh@oracle.com> | 2006-06-26 17:43:14 -0400 |
commit | b220532a71adf65d45c3aa8a284bfa7ec57957bd (patch) | |
tree | c9aa6167aed4e2e7357e467f7b91957b5c114c53 /fs/ocfs2/dlm/dlmconvert.c | |
parent | f85cd47a5825b77a146bad6870b2ddcf08415c13 (diff) |
ocfs2: retry operations when a lock is marked in recovery
Before checking for a nonexistent lock, make sure the lockres is not marked
RECOVERING. The caller will just retry and the state should be fixed up when
recovery completes.
Signed-off-by: Kurt Hackel <kurt.hackel@oracle.com>
Signed-off-by: Mark Fasheh <mark.fasheh@oracle.com>
Diffstat (limited to 'fs/ocfs2/dlm/dlmconvert.c')
-rw-r--r-- | fs/ocfs2/dlm/dlmconvert.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/fs/ocfs2/dlm/dlmconvert.c b/fs/ocfs2/dlm/dlmconvert.c index 90cbaaff33a7..2f7ad5261281 100644 --- a/fs/ocfs2/dlm/dlmconvert.c +++ b/fs/ocfs2/dlm/dlmconvert.c | |||
@@ -464,6 +464,12 @@ int dlm_convert_lock_handler(struct o2net_msg *msg, u32 len, void *data) | |||
464 | } | 464 | } |
465 | 465 | ||
466 | spin_lock(&res->spinlock); | 466 | spin_lock(&res->spinlock); |
467 | status = __dlm_lockres_state_to_status(res); | ||
468 | if (status != DLM_NORMAL) { | ||
469 | spin_unlock(&res->spinlock); | ||
470 | dlm_error(status); | ||
471 | goto leave; | ||
472 | } | ||
467 | list_for_each(iter, &res->granted) { | 473 | list_for_each(iter, &res->granted) { |
468 | lock = list_entry(iter, struct dlm_lock, list); | 474 | lock = list_entry(iter, struct dlm_lock, list); |
469 | if (lock->ml.cookie == cnv->cookie && | 475 | if (lock->ml.cookie == cnv->cookie && |
@@ -473,6 +479,20 @@ int dlm_convert_lock_handler(struct o2net_msg *msg, u32 len, void *data) | |||
473 | } | 479 | } |
474 | lock = NULL; | 480 | lock = NULL; |
475 | } | 481 | } |
482 | if (!lock) { | ||
483 | __dlm_print_one_lock_resource(res); | ||
484 | list_for_each(iter, &res->granted) { | ||
485 | lock = list_entry(iter, struct dlm_lock, list); | ||
486 | if (lock->ml.node == cnv->node_idx) { | ||
487 | mlog(0, "There is something here " | ||
488 | "for node %u, lock->ml.cookie=%llu, " | ||
489 | "cnv->cookie=%llu\n", cnv->node_idx, | ||
490 | lock->ml.cookie, cnv->cookie); | ||
491 | break; | ||
492 | } | ||
493 | } | ||
494 | lock = NULL; | ||
495 | } | ||
476 | spin_unlock(&res->spinlock); | 496 | spin_unlock(&res->spinlock); |
477 | if (!lock) { | 497 | if (!lock) { |
478 | status = DLM_IVLOCKID; | 498 | status = DLM_IVLOCKID; |