aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ocfs2
diff options
context:
space:
mode:
authorKurt Hackel <kurt.hackel@oracle.com>2006-04-27 21:05:41 -0400
committerMark Fasheh <mark.fasheh@oracle.com>2006-06-26 17:42:48 -0400
commitc3187ce5e335cf8e06391236cc1ad7d1b1e193ed (patch)
tree2e7ec4cafda7a3c62b93eab72166f6c98811d64c /fs/ocfs2
parentab27eb6f47092923a92f7c164dcf9be3b76f3944 (diff)
ocfs2: only recover one dead node at a time
Signed-off-by: Kurt Hackel <kurt.hackel@oracle.com> Signed-off-by: Mark Fasheh <mark.fasheh@oracle.com>
Diffstat (limited to 'fs/ocfs2')
-rw-r--r--fs/ocfs2/dlm/dlmrecovery.c38
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");