From 4f43737df882ce38d3977af2e82a0594f4c5bfe8 Mon Sep 17 00:00:00 2001 From: "Yan, Zheng" Date: Wed, 7 Jun 2017 09:17:42 +0800 Subject: [PATCH] mds: don't mark nestlock dirty on improper inode If inode is replica and it has no auth subtree dirfrag, We should not mark its nestlock dirty. Signed-off-by: "Yan, Zheng" --- src/mds/CInode.cc | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/mds/CInode.cc b/src/mds/CInode.cc index 567668a1243..4e6af3e97cb 100644 --- a/src/mds/CInode.cc +++ b/src/mds/CInode.cc @@ -339,11 +339,16 @@ void CInode::mark_dirty_rstat() dout(10) << "mark_dirty_rstat" << dendl; state_set(STATE_DIRTYRSTAT); get(PIN_DIRTYRSTAT); - CDentry *dn = get_projected_parent_dn(); - CDir *pdir = dn->dir; - pdir->dirty_rstat_inodes.push_back(&dirty_rstat_item); - - mdcache->mds->locker->mark_updated_scatterlock(&pdir->inode->nestlock); + CDentry *pdn = get_projected_parent_dn(); + if (pdn->is_auth()) { + CDir *pdir = pdn->dir; + pdir->dirty_rstat_inodes.push_back(&dirty_rstat_item); + mdcache->mds->locker->mark_updated_scatterlock(&pdir->inode->nestlock); + } else { + // under cross-MDS rename. + // DIRTYRSTAT flag will get cleared when rename finishes + assert(state_test(STATE_AMBIGUOUSAUTH)); + } } } void CInode::clear_dirty_rstat() -- 2.39.5