From: Yan, Zheng Date: Fri, 7 Nov 2014 03:38:37 +0000 (+0800) Subject: mds: store backtrace for straydir X-Git-Tag: v0.90~34^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F2769%2Fhead;p=ceph.git mds: store backtrace for straydir Signed-off-by: Yan, Zheng --- diff --git a/src/mds/MDCache.cc b/src/mds/MDCache.cc index ebd175504b3a..067f360182bc 100644 --- a/src/mds/MDCache.cc +++ b/src/mds/MDCache.cc @@ -413,6 +413,8 @@ void MDCache::create_mydir_hierarchy(MDSGather *gather) CDir *mydir = my->get_or_open_dirfrag(this, frag_t()); adjust_subtree_auth(mydir, mds->whoami); + LogSegment *ls = mds->mdlog->get_current_segment(); + // stray dir for (int i = 0; i < NUM_STRAY; ++i) { CInode *stray = create_system_inode(MDS_INO_STRAY(mds->whoami, i), S_IFDIR); @@ -428,8 +430,10 @@ void MDCache::create_mydir_hierarchy(MDSGather *gather) mydir->fnode.fragstat.nsubdirs++; // save them straydir->mark_complete(); - straydir->mark_dirty(straydir->pre_dirty(), mds->mdlog->get_current_segment()); + straydir->mark_dirty(straydir->pre_dirty(), ls); straydir->commit(0, gather->new_sub()); + stray->_mark_dirty_parent(ls, true); + stray->store_backtrace(gather->new_sub()); } CInode *journal = create_system_inode(MDS_INO_LOG_OFFSET + mds->whoami, S_IFREG); @@ -449,7 +453,7 @@ void MDCache::create_mydir_hierarchy(MDSGather *gather) mydir->mark_complete(); - mydir->mark_dirty(mydir->pre_dirty(), mds->mdlog->get_current_segment()); + mydir->mark_dirty(mydir->pre_dirty(), ls); mydir->commit(0, gather->new_sub()); myin->store(gather->new_sub());