From: Yan, Zheng Date: Fri, 7 Nov 2014 03:38:37 +0000 (+0800) Subject: mds: store backtrace for straydir X-Git-Tag: v0.87.1~48^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=309fd5f56ef5ea76ffd525fdde6e6fbbc9ef6ef1;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 ea5bb3616018..b6af0743f353 100644 --- a/src/mds/MDCache.cc +++ b/src/mds/MDCache.cc @@ -406,6 +406,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); @@ -421,8 +423,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); @@ -442,7 +446,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());