]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: always mark parent scatterlock when marking dirty rstat
authorSage Weil <sage@newdream.net>
Fri, 24 Sep 2010 15:15:54 +0000 (08:15 -0700)
committerSage Weil <sage@newdream.net>
Fri, 24 Sep 2010 18:44:22 +0000 (11:44 -0700)
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
src/mds/MDCache.cc

index 1a85fc3f7a77034477b4830cb34de5067b391475..45f6fc2f0869810c1beb11b628d2289706f9ceed 100644 (file)
@@ -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()
index e1063136fe67cccb3680260319df5c9335fa0f3c..176c150293806c6aaec79baa16b409ae9df16b5a 100644 (file)
@@ -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();