From: Yan, Zheng Date: Fri, 7 Nov 2014 03:38:37 +0000 (+0800) Subject: mds: store backtrace for straydir X-Git-Tag: v0.80.8~14^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=a5970963a2148697fc6da64facfbf6ab6686b9cd;p=ceph.git mds: store backtrace for straydir Backport: giant, firefly, emperor, dumpling Signed-off-by: Yan, Zheng (cherry picked from commit 0d89db5d3e5ae5d552d4058a88a4e186748ab1d2) --- diff --git a/src/mds/MDCache.cc b/src/mds/MDCache.cc index d6cfebdda119..6c52fbdaecea 100644 --- a/src/mds/MDCache.cc +++ b/src/mds/MDCache.cc @@ -369,6 +369,8 @@ void MDCache::create_mydir_hierarchy(C_Gather *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); @@ -384,8 +386,10 @@ void MDCache::create_mydir_hierarchy(C_Gather *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); @@ -405,7 +409,7 @@ void MDCache::create_mydir_hierarchy(C_Gather *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());