]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: fix nested_anchors update during journal replay
authorYan, Zheng <zheng.z.yan@intel.com>
Wed, 26 Feb 2014 02:17:34 +0000 (10:17 +0800)
committerGreg Farnum <greg@inktank.com>
Wed, 26 Feb 2014 15:12:49 +0000 (07:12 -0800)
check if the inode is anchored/unanchored before updating the inode

Fixes: #7530
Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
Reviewed-by: Greg Farnum <greg@inktank.com>
src/mds/journal.cc

index a4834f596bd5ff6d3edf2eede3a145dd30c70843..f818d7c410a89181332a9d11df6a7add99bcab77 100644 (file)
@@ -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()) {