Commit b220532a71adf65d45c3aa8a284bfa7ec57957bd
Committed by
Mark Fasheh
1 parent
f85cd47a58
Exists in
master
and in
4 other branches
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>
Showing 1 changed file with 20 additions and 0 deletions Side-by-side Diff
fs/ocfs2/dlm/dlmconvert.c
| ... | ... | @@ -464,12 +464,32 @@ |
| 464 | 464 | } |
| 465 | 465 | |
| 466 | 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 | 473 | list_for_each(iter, &res->granted) { |
| 468 | 474 | lock = list_entry(iter, struct dlm_lock, list); |
| 469 | 475 | if (lock->ml.cookie == cnv->cookie && |
| 470 | 476 | lock->ml.node == cnv->node_idx) { |
| 471 | 477 | dlm_lock_get(lock); |
| 472 | 478 | break; |
| 479 | + } | |
| 480 | + lock = NULL; | |
| 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 | + } | |
| 473 | 493 | } |
| 474 | 494 | lock = NULL; |
| 475 | 495 | } |