dlmrecovery.c (343e26a4007d14c2154c1d13d1209797dce5c535) | dlmrecovery.c (ccd8b1f916bc5e4b2156f03ccd3546be7f65f6b3) |
---|---|
1/* -*- mode: c; c-basic-offset: 8; -*- 2 * vim: noexpandtab sw=8 ts=8 sts=0: 3 * 4 * dlmrecovery.c 5 * 6 * recovery stuff 7 * 8 * Copyright (C) 2004 Oracle. All rights reserved. --- 1660 unchanged lines hidden (view full) --- 1669 dlm_lock_attach_lockres(newlock, res); 1670 1671 if (ml->convert_type != LKM_IVMODE) { 1672 BUG_ON(queue != &res->converting); 1673 newlock->ml.convert_type = ml->convert_type; 1674 } 1675 lksb->flags |= (ml->flags & 1676 (DLM_LKSB_PUT_LVB|DLM_LKSB_GET_LVB)); | 1/* -*- mode: c; c-basic-offset: 8; -*- 2 * vim: noexpandtab sw=8 ts=8 sts=0: 3 * 4 * dlmrecovery.c 5 * 6 * recovery stuff 7 * 8 * Copyright (C) 2004 Oracle. All rights reserved. --- 1660 unchanged lines hidden (view full) --- 1669 dlm_lock_attach_lockres(newlock, res); 1670 1671 if (ml->convert_type != LKM_IVMODE) { 1672 BUG_ON(queue != &res->converting); 1673 newlock->ml.convert_type = ml->convert_type; 1674 } 1675 lksb->flags |= (ml->flags & 1676 (DLM_LKSB_PUT_LVB|DLM_LKSB_GET_LVB)); |
1677 | 1677 1678 if (ml->type == LKM_NLMODE) 1679 goto skip_lvb; 1680 |
1678 if (!dlm_lvb_is_empty(mres->lvb)) { 1679 if (lksb->flags & DLM_LKSB_PUT_LVB) { 1680 /* other node was trying to update 1681 * lvb when node died. recreate the 1682 * lksb with the updated lvb. */ 1683 memcpy(lksb->lvb, mres->lvb, DLM_LVB_LEN); | 1681 if (!dlm_lvb_is_empty(mres->lvb)) { 1682 if (lksb->flags & DLM_LKSB_PUT_LVB) { 1683 /* other node was trying to update 1684 * lvb when node died. recreate the 1685 * lksb with the updated lvb. */ 1686 memcpy(lksb->lvb, mres->lvb, DLM_LVB_LEN); |
1687 /* the lock resource lvb update must happen 1688 * NOW, before the spinlock is dropped. 1689 * we no longer wait for the AST to update 1690 * the lvb. */ 1691 memcpy(res->lvb, mres->lvb, DLM_LVB_LEN); |
|
1684 } else { 1685 /* otherwise, the node is sending its 1686 * most recent valid lvb info */ 1687 BUG_ON(ml->type != LKM_EXMODE && 1688 ml->type != LKM_PRMODE); 1689 if (!dlm_lvb_is_empty(res->lvb) && | 1692 } else { 1693 /* otherwise, the node is sending its 1694 * most recent valid lvb info */ 1695 BUG_ON(ml->type != LKM_EXMODE && 1696 ml->type != LKM_PRMODE); 1697 if (!dlm_lvb_is_empty(res->lvb) && |
1690 (ml->type == LKM_EXMODE || 1691 memcmp(res->lvb, mres->lvb, DLM_LVB_LEN))) { 1692 int i; 1693 mlog(ML_ERROR, "%s:%.*s: received bad " 1694 "lvb! type=%d\n", dlm->name, 1695 res->lockname.len, 1696 res->lockname.name, ml->type); 1697 printk("lockres lvb=["); 1698 for (i=0; i<DLM_LVB_LEN; i++) 1699 printk("%02x", res->lvb[i]); 1700 printk("]\nmigrated lvb=["); 1701 for (i=0; i<DLM_LVB_LEN; i++) 1702 printk("%02x", mres->lvb[i]); 1703 printk("]\n"); 1704 dlm_print_one_lock_resource(res); 1705 BUG(); | 1698 (ml->type == LKM_EXMODE || 1699 memcmp(res->lvb, mres->lvb, DLM_LVB_LEN))) { 1700 int i; 1701 mlog(ML_ERROR, "%s:%.*s: received bad " 1702 "lvb! type=%d\n", dlm->name, 1703 res->lockname.len, 1704 res->lockname.name, ml->type); 1705 printk("lockres lvb=["); 1706 for (i=0; i<DLM_LVB_LEN; i++) 1707 printk("%02x", res->lvb[i]); 1708 printk("]\nmigrated lvb=["); 1709 for (i=0; i<DLM_LVB_LEN; i++) 1710 printk("%02x", mres->lvb[i]); 1711 printk("]\n"); 1712 dlm_print_one_lock_resource(res); 1713 BUG(); |
1706 } 1707 memcpy(res->lvb, mres->lvb, DLM_LVB_LEN); 1708 } 1709 } | 1714 } 1715 memcpy(res->lvb, mres->lvb, DLM_LVB_LEN); 1716 } 1717 } |
1718skip_lvb: |
|
1710 | 1719 |
1711 | |
1712 /* NOTE: 1713 * wrt lock queue ordering and recovery: 1714 * 1. order of locks on granted queue is 1715 * meaningless. 1716 * 2. order of locks on converting queue is 1717 * LOST with the node death. sorry charlie. 1718 * 3. order of locks on the blocked queue is 1719 * also LOST. --- 889 unchanged lines hidden --- | 1720 /* NOTE: 1721 * wrt lock queue ordering and recovery: 1722 * 1. order of locks on granted queue is 1723 * meaningless. 1724 * 2. order of locks on converting queue is 1725 * LOST with the node death. sorry charlie. 1726 * 3. order of locks on the blocked queue is 1727 * also LOST. --- 889 unchanged lines hidden --- |