aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ocfs2/dlm/dlmrecovery.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/ocfs2/dlm/dlmrecovery.c')
-rw-r--r--fs/ocfs2/dlm/dlmrecovery.c44
1 files changed, 26 insertions, 18 deletions
diff --git a/fs/ocfs2/dlm/dlmrecovery.c b/fs/ocfs2/dlm/dlmrecovery.c
index de68e498bfad..86199f66eb56 100644
--- a/fs/ocfs2/dlm/dlmrecovery.c
+++ b/fs/ocfs2/dlm/dlmrecovery.c
@@ -1674,40 +1674,48 @@ static int dlm_process_recovery_data(struct dlm_ctxt *dlm,
1674 } 1674 }
1675 lksb->flags |= (ml->flags & 1675 lksb->flags |= (ml->flags &
1676 (DLM_LKSB_PUT_LVB|DLM_LKSB_GET_LVB)); 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)) { 1681 if (!dlm_lvb_is_empty(mres->lvb)) {
1679 if (lksb->flags & DLM_LKSB_PUT_LVB) { 1682 if (lksb->flags & DLM_LKSB_PUT_LVB) {
1680 /* other node was trying to update 1683 /* other node was trying to update
1681 * lvb when node died. recreate the 1684 * lvb when node died. recreate the
1682 * lksb with the updated lvb. */ 1685 * lksb with the updated lvb. */
1683 memcpy(lksb->lvb, mres->lvb, DLM_LVB_LEN); 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 { 1692 } else {
1685 /* otherwise, the node is sending its 1693 /* otherwise, the node is sending its
1686 * most recent valid lvb info */ 1694 * most recent valid lvb info */
1687 BUG_ON(ml->type != LKM_EXMODE && 1695 BUG_ON(ml->type != LKM_EXMODE &&
1688 ml->type != LKM_PRMODE); 1696 ml->type != LKM_PRMODE);
1689 if (!dlm_lvb_is_empty(res->lvb) && 1697 if (!dlm_lvb_is_empty(res->lvb) &&
1690 (ml->type == LKM_EXMODE || 1698 (ml->type == LKM_EXMODE ||
1691 memcmp(res->lvb, mres->lvb, DLM_LVB_LEN))) { 1699 memcmp(res->lvb, mres->lvb, DLM_LVB_LEN))) {
1692 int i; 1700 int i;
1693 mlog(ML_ERROR, "%s:%.*s: received bad " 1701 mlog(ML_ERROR, "%s:%.*s: received bad "
1694 "lvb! type=%d\n", dlm->name, 1702 "lvb! type=%d\n", dlm->name,
1695 res->lockname.len, 1703 res->lockname.len,
1696 res->lockname.name, ml->type); 1704 res->lockname.name, ml->type);
1697 printk("lockres lvb=["); 1705 printk("lockres lvb=[");
1698 for (i=0; i<DLM_LVB_LEN; i++) 1706 for (i=0; i<DLM_LVB_LEN; i++)
1699 printk("%02x", res->lvb[i]); 1707 printk("%02x", res->lvb[i]);
1700 printk("]\nmigrated lvb=["); 1708 printk("]\nmigrated lvb=[");
1701 for (i=0; i<DLM_LVB_LEN; i++) 1709 for (i=0; i<DLM_LVB_LEN; i++)
1702 printk("%02x", mres->lvb[i]); 1710 printk("%02x", mres->lvb[i]);
1703 printk("]\n"); 1711 printk("]\n");
1704 dlm_print_one_lock_resource(res); 1712 dlm_print_one_lock_resource(res);
1705 BUG(); 1713 BUG();
1706 } 1714 }
1707 memcpy(res->lvb, mres->lvb, DLM_LVB_LEN); 1715 memcpy(res->lvb, mres->lvb, DLM_LVB_LEN);
1708 } 1716 }
1709 } 1717 }
1710 1718skip_lvb:
1711 1719
1712 /* NOTE: 1720 /* NOTE:
1713 * wrt lock queue ordering and recovery: 1721 * wrt lock queue ordering and recovery: