diff options
-rw-r--r-- | fs/ocfs2/dlm/dlmrecovery.c | 38 |
1 files changed, 35 insertions, 3 deletions
diff --git a/fs/ocfs2/dlm/dlmrecovery.c b/fs/ocfs2/dlm/dlmrecovery.c index ee0860bb6734..394887637289 100644 --- a/fs/ocfs2/dlm/dlmrecovery.c +++ b/fs/ocfs2/dlm/dlmrecovery.c | |||
@@ -710,6 +710,14 @@ int dlm_request_all_locks_handler(struct o2net_msg *msg, u32 len, void *data) | |||
710 | if (!dlm_grab(dlm)) | 710 | if (!dlm_grab(dlm)) |
711 | return -EINVAL; | 711 | return -EINVAL; |
712 | 712 | ||
713 | if (lr->dead_node != dlm->reco.dead_node) { | ||
714 | mlog(ML_ERROR, "%s: node %u sent dead_node=%u, but local " | ||
715 | "dead_node is %u\n", dlm->name, lr->node_idx, | ||
716 | lr->dead_node, dlm->reco.dead_node); | ||
717 | /* this is a hack */ | ||
718 | dlm_put(dlm); | ||
719 | return -ENOMEM; | ||
720 | } | ||
713 | BUG_ON(lr->dead_node != dlm->reco.dead_node); | 721 | BUG_ON(lr->dead_node != dlm->reco.dead_node); |
714 | 722 | ||
715 | item = kcalloc(1, sizeof(*item), GFP_KERNEL); | 723 | item = kcalloc(1, sizeof(*item), GFP_KERNEL); |
@@ -1504,7 +1512,7 @@ static int dlm_process_recovery_data(struct dlm_ctxt *dlm, | |||
1504 | struct dlm_lock *newlock = NULL; | 1512 | struct dlm_lock *newlock = NULL; |
1505 | struct dlm_lockstatus *lksb = NULL; | 1513 | struct dlm_lockstatus *lksb = NULL; |
1506 | int ret = 0; | 1514 | int ret = 0; |
1507 | int i; | 1515 | int i, bad; |
1508 | struct list_head *iter; | 1516 | struct list_head *iter; |
1509 | struct dlm_lock *lock = NULL; | 1517 | struct dlm_lock *lock = NULL; |
1510 | 1518 | ||
@@ -1613,9 +1621,33 @@ static int dlm_process_recovery_data(struct dlm_ctxt *dlm, | |||
1613 | * relative to each other, but clearly *not* | 1621 | * relative to each other, but clearly *not* |
1614 | * preserved relative to locks from other nodes. | 1622 | * preserved relative to locks from other nodes. |
1615 | */ | 1623 | */ |
1624 | bad = 0; | ||
1616 | spin_lock(&res->spinlock); | 1625 | spin_lock(&res->spinlock); |
1617 | dlm_lock_get(newlock); | 1626 | list_for_each_entry(lock, queue, list) { |
1618 | list_add_tail(&newlock->list, queue); | 1627 | if (lock->ml.cookie == ml->cookie) { |
1628 | u64 c = lock->ml.cookie; | ||
1629 | mlog(ML_ERROR, "%s:%.*s: %u:%llu: lock already " | ||
1630 | "exists on this lockres!\n", dlm->name, | ||
1631 | res->lockname.len, res->lockname.name, | ||
1632 | dlm_get_lock_cookie_node(c), | ||
1633 | dlm_get_lock_cookie_seq(c)); | ||
1634 | |||
1635 | mlog(ML_NOTICE, "sent lock: type=%d, conv=%d, " | ||
1636 | "node=%u, cookie=%u:%llu, queue=%d\n", | ||
1637 | ml->type, ml->convert_type, ml->node, | ||
1638 | dlm_get_lock_cookie_node(ml->cookie), | ||
1639 | dlm_get_lock_cookie_seq(ml->cookie), | ||
1640 | ml->list); | ||
1641 | |||
1642 | __dlm_print_one_lock_resource(res); | ||
1643 | bad = 1; | ||
1644 | break; | ||
1645 | } | ||
1646 | } | ||
1647 | if (!bad) { | ||
1648 | dlm_lock_get(newlock); | ||
1649 | list_add_tail(&newlock->list, queue); | ||
1650 | } | ||
1619 | spin_unlock(&res->spinlock); | 1651 | spin_unlock(&res->spinlock); |
1620 | } | 1652 | } |
1621 | mlog(0, "done running all the locks\n"); | 1653 | mlog(0, "done running all the locks\n"); |