From: Yan, Zheng Date: Wed, 26 Feb 2014 02:17:34 +0000 (+0800) Subject: mds: fix nested_anchors update during journal replay X-Git-Tag: v0.78~115 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=7ba3200f1e91d803cdf84f96777641f7d18d3c01;p=ceph.git mds: fix nested_anchors update during journal replay check if the inode is anchored/unanchored before updating the inode Fixes: #7530 Signed-off-by: Yan, Zheng Reviewed-by: Greg Farnum --- diff --git a/src/mds/journal.cc b/src/mds/journal.cc index a4834f596bd5..f818d7c410a8 100644 --- a/src/mds/journal.cc +++ b/src/mds/journal.cc @@ -1078,14 +1078,14 @@ void EMetaBlob::replay(MDS *mds, LogSegment *logseg, MDSlaveUpdate *slaveup) if (p->is_dirty()) in->_mark_dirty(logseg); dout(10) << "EMetaBlob.replay added " << *in << dendl; } else { + if (in->get_parent_dn() && in->inode.anchored != p->inode.anchored) + in->get_parent_dn()->adjust_nested_anchors((int)p->inode.anchored - (int)in->inode.anchored); p->update_inode(mds, in); if (dn->get_linkage()->get_inode() != in && in->get_parent_dn()) { dout(10) << "EMetaBlob.replay unlinking " << *in << dendl; unlinked[in] = in->get_parent_dir(); in->get_parent_dir()->unlink_inode(in->get_parent_dn()); } - if (in->get_parent_dn() && in->inode.anchored != p->inode.anchored) - in->get_parent_dn()->adjust_nested_anchors( (int)p->inode.anchored - (int)in->inode.anchored ); if (dn->get_linkage()->get_inode() != in) { if (!dn->get_linkage()->is_null()) { // note: might be remote. as with stray reintegration. if (dn->get_linkage()->is_primary()) {