From f0c89bab41deca8e361983d0d6f722367076b556 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Fri, 24 Sep 2010 08:15:54 -0700 Subject: [PATCH] mds: always mark parent scatterlock when marking dirty rstat Note that this will let the parent nestlock 'dirty' state get out of sync with the lock state, as the whole point of the dirty rstat lists is that it can happen any time. It does, however, queue us up. --- src/mds/CInode.cc | 5 ++++- src/mds/MDCache.cc | 1 - 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/mds/CInode.cc b/src/mds/CInode.cc index 1a85fc3f7a770..45f6fc2f08698 100644 --- a/src/mds/CInode.cc +++ b/src/mds/CInode.cc @@ -229,7 +229,10 @@ void CInode::mark_dirty_rstat() state_set(STATE_DIRTYRSTAT); get(PIN_DIRTYRSTAT); CDentry *dn = get_projected_parent_dn(); - dn->dir->dirty_rstat_inodes.push_back(&dirty_rstat_item); + CDir *pdir = dn->dir; + pdir->dirty_rstat_inodes.push_back(&dirty_rstat_item); + + mdcache->mds->locker->mark_updated_scatterlock(&pdir->inode->nestlock); } } void CInode::clear_dirty_rstat() diff --git a/src/mds/MDCache.cc b/src/mds/MDCache.cc index e1063136fe67c..176c150293806 100644 --- a/src/mds/MDCache.cc +++ b/src/mds/MDCache.cc @@ -1759,7 +1759,6 @@ void MDCache::predirty_journal_parents(Mutation *mut, EMetaBlob *blob, dout(20) << " unwritable parent nestlock " << parent->inode->nestlock << ", marking dirty rstat on " << *cur << dendl; cur->mark_dirty_rstat(); - mds->locker->mark_updated_scatterlock(&parent->inode->nestlock); } else { SnapRealm *prealm = parent->inode->find_snaprealm(); -- 2.39.5