]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: be more forgiving on EPurgeFinish
authorSage Weil <sage@newdream.net>
Sat, 15 Nov 2008 00:54:32 +0000 (16:54 -0800)
committerSage Weil <sage@newdream.net>
Mon, 17 Nov 2008 18:51:28 +0000 (10:51 -0800)
Inode may not be in cache because of purge_stray() avoiding
journaling it's intent to purge.  If that changes down the line,
add the assertion back.

src/mds/MDCache.cc
src/mds/journal.cc

index 68cccd7d46439608e626706cce73d302742507d4..e1440ff4844320ec692fd11d87978b725982397c 100644 (file)
@@ -6387,6 +6387,10 @@ void MDCache::purge_stray(CDentry *dn)
   // CHEAT.  there's no real need to journal our intent to purge, since
   // that is implicit in the dentry's presence and non-use in the stray
   // dir.  on recovery, we'll need to re-eval all strays anyway.
+  //
+  // as a result, we adjust EPurgeFinish::replay to forgive us if hte
+  // inode isn't in the cache.  If we later decide to journal our
+  // intent here, add that assertion back.
 
   purge_inode(in, 0, in->inode.size, mds->mdlog->get_current_segment());
   waiting_for_purge[in][0].push_back(new C_MDC_PurgeStrayPurged(this, dn));
index eccb6d4d0fd79bd645c6d10e0310d25920915399..06cf6de402e6acc3e6c04356690ad1a99781db0e 100644 (file)
@@ -864,6 +864,12 @@ void EPurgeFinish::replay(MDS *mds)
 {
   dout(10) << "EPurgeFinish.replay " << ino << " " << oldsize << " -> " << newsize << dendl;
   CInode *in = mds->mdcache->get_inode(ino);
+
+  // if we don't have *in at this point, it's because purge_stray is lazy and
+  // doesn't jouranl it's intent to purge.  no worries, if *in isn't in the cache,
+  // it's not in the purge table either.  we'll eval_stray when we finish
+  // recovery.
+  //assert(in);
   if (in)
     mds->mdcache->remove_recovered_purge(in, newsize, oldsize);
 }