summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYan, Zheng <zheng.z.yan@intel.com>2013-09-04 09:58:23 +0800
committerYan, Zheng <zheng.z.yan@intel.com>2013-09-19 14:01:02 +0800
commit862e0f12a6458e7e1dbb24ea50548a8968635485 (patch)
tree2e4d88961dd51f73fed58b13cda1937e6c890ce6
parent96010924cbbcbd00ca4605fb6a5a336ccfa43c7d (diff)
downloadceph-862e0f12a6458e7e1dbb24ea50548a8968635485.tar.gz
mds: fix MDCache::truncate_inode_finish() journal
we should add projected parent directory's context to the journal Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
-rw-r--r--src/mds/MDCache.cc5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/mds/MDCache.cc b/src/mds/MDCache.cc
index 86b380f2827..786b0ac0742 100644
--- a/src/mds/MDCache.cc
+++ b/src/mds/MDCache.cc
@@ -5934,8 +5934,9 @@ void MDCache::truncate_inode_finish(CInode *in, LogSegment *ls)
EUpdate *le = new EUpdate(mds->mdlog, "truncate finish");
mds->mdlog->start_entry(le);
- le->metablob.add_dir_context(in->get_parent_dir());
- le->metablob.add_primary_dentry(in->get_projected_parent_dn(), in, true);
+ CDentry *dn = in->get_projected_parent_dn();
+ le->metablob.add_dir_context(dn->get_dir());
+ le->metablob.add_primary_dentry(dn, in, true);
le->metablob.add_truncate_finish(in->ino(), ls->offset);
journal_dirty_inode(mut, &le->metablob, in);