提交 ccd8b1f9 编写于 作者: K Kurt Hackel 提交者: Mark Fasheh

ocfs2: update lvb immediately during recovery

Signed-off-by: NKurt Hackel <kurt.hackel@oracle.com>
Signed-off-by: NMark Fasheh <mark.fasheh@oracle.com>
上级 588e0090
...@@ -1674,40 +1674,48 @@ static int dlm_process_recovery_data(struct dlm_ctxt *dlm, ...@@ -1674,40 +1674,48 @@ static int dlm_process_recovery_data(struct dlm_ctxt *dlm,
} }
lksb->flags |= (ml->flags & lksb->flags |= (ml->flags &
(DLM_LKSB_PUT_LVB|DLM_LKSB_GET_LVB)); (DLM_LKSB_PUT_LVB|DLM_LKSB_GET_LVB));
if (ml->type == LKM_NLMODE)
goto skip_lvb;
if (!dlm_lvb_is_empty(mres->lvb)) { if (!dlm_lvb_is_empty(mres->lvb)) {
if (lksb->flags & DLM_LKSB_PUT_LVB) { if (lksb->flags & DLM_LKSB_PUT_LVB) {
/* other node was trying to update /* other node was trying to update
* lvb when node died. recreate the * lvb when node died. recreate the
* lksb with the updated lvb. */ * lksb with the updated lvb. */
memcpy(lksb->lvb, mres->lvb, DLM_LVB_LEN); memcpy(lksb->lvb, mres->lvb, DLM_LVB_LEN);
/* the lock resource lvb update must happen
* NOW, before the spinlock is dropped.
* we no longer wait for the AST to update
* the lvb. */
memcpy(res->lvb, mres->lvb, DLM_LVB_LEN);
} else { } else {
/* otherwise, the node is sending its /* otherwise, the node is sending its
* most recent valid lvb info */ * most recent valid lvb info */
BUG_ON(ml->type != LKM_EXMODE && BUG_ON(ml->type != LKM_EXMODE &&
ml->type != LKM_PRMODE); ml->type != LKM_PRMODE);
if (!dlm_lvb_is_empty(res->lvb) && if (!dlm_lvb_is_empty(res->lvb) &&
(ml->type == LKM_EXMODE || (ml->type == LKM_EXMODE ||
memcmp(res->lvb, mres->lvb, DLM_LVB_LEN))) { memcmp(res->lvb, mres->lvb, DLM_LVB_LEN))) {
int i; int i;
mlog(ML_ERROR, "%s:%.*s: received bad " mlog(ML_ERROR, "%s:%.*s: received bad "
"lvb! type=%d\n", dlm->name, "lvb! type=%d\n", dlm->name,
res->lockname.len, res->lockname.len,
res->lockname.name, ml->type); res->lockname.name, ml->type);
printk("lockres lvb=["); printk("lockres lvb=[");
for (i=0; i<DLM_LVB_LEN; i++) for (i=0; i<DLM_LVB_LEN; i++)
printk("%02x", res->lvb[i]); printk("%02x", res->lvb[i]);
printk("]\nmigrated lvb=["); printk("]\nmigrated lvb=[");
for (i=0; i<DLM_LVB_LEN; i++) for (i=0; i<DLM_LVB_LEN; i++)
printk("%02x", mres->lvb[i]); printk("%02x", mres->lvb[i]);
printk("]\n"); printk("]\n");
dlm_print_one_lock_resource(res); dlm_print_one_lock_resource(res);
BUG(); BUG();
} }
memcpy(res->lvb, mres->lvb, DLM_LVB_LEN); memcpy(res->lvb, mres->lvb, DLM_LVB_LEN);
} }
} }
skip_lvb:
/* NOTE: /* NOTE:
* wrt lock queue ordering and recovery: * wrt lock queue ordering and recovery:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册