Skip to content

Commit

Permalink
mds: fix nested_anchors update during journal replay
Browse files Browse the repository at this point in the history
check if the inode is anchored/unanchored before updating the inode

Fixes: ceph#7530
Signed-off-by: Yan, Zheng <[email protected]>
Reviewed-by: Greg Farnum <[email protected]>
  • Loading branch information
Yan, Zheng authored and gregsfortytwo committed Feb 26, 2014
1 parent 82aba4b commit 7ba3200
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/mds/journal.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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()) {
Expand Down

0 comments on commit 7ba3200

Please sign in to comment.