From c25e6e7701042b860cc7f0e3b7b0e79f2ad99deb Mon Sep 17 00:00:00 2001 From: "Yan, Zheng" Date: Fri, 7 Nov 2014 11:38:37 +0800 Subject: [PATCH] mds: store backtrace for straydir Backport: giant, firefly, emperor, dumpling Signed-off-by: Yan, Zheng (cherry picked from commit 0d89db5d3e5ae5d552d4058a88a4e186748ab1d2) --- src/mds/MDCache.cc | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/mds/MDCache.cc b/src/mds/MDCache.cc index ae59c26ee13bf..bb15515628652 100644 --- a/src/mds/MDCache.cc +++ b/src/mds/MDCache.cc @@ -384,6 +384,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); @@ -399,8 +401,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); @@ -419,7 +423,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()); -- 2.39.5