]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: use fnode when replaying journal
authorSage Weil <sage@newdream.net>
Wed, 4 Nov 2009 23:22:11 +0000 (15:22 -0800)
committerSage Weil <sage@newdream.net>
Wed, 4 Nov 2009 23:22:11 +0000 (15:22 -0800)
We weren't actually pulling the fnode from the journal. I'm
surprised anything worked.

This fixes a crash when untaring, restarting mds, and then
rm -r'ing the dir.  Previously the rstat would roll
negative and assert.

src/TODO
src/mds/CDir.cc
src/mds/journal.cc

index 4beb239d53b472259028ace2e8bfdc2306a2bc25..e9fc740b26c205ab3c17dd50fa767113df3dc67e 100644 (file)
--- a/src/TODO
+++ b/src/TODO
@@ -64,7 +64,6 @@ bugs
 - mislinked directory?
 - premature filejournal trimming?
 - weird osd_lock contention during osd restart?
-- rstat corruption on kernal untar, make, rm -f (maybe due to mds restart?)
 
 greg
 - osd: use client session to control osdmaps to clients (auth branch)
index 2359ec812f65c73e9d560cb5f06d81ce1cc7bb88..95345d189b083a1d26c275ec3a6179bdf9ec24f8 100644 (file)
@@ -102,8 +102,17 @@ ostream& operator<<(ostream& out, CDir& dir)
       << "=" << dir.fnode.fragstat.nfiles
       << "+" << dir.fnode.fragstat.nsubdirs;
   out << " rb=" << dir.fnode.rstat.rbytes << "/" << dir.fnode.accounted_rstat.rbytes;
+  if (dir.is_projected())
+    out << "|" << dir.get_projected_fnode()->rstat.rbytes
+       << "/" << dir.get_projected_fnode()->accounted_rstat.rbytes;
   out << " rf=" << dir.fnode.rstat.rfiles << "/" << dir.fnode.accounted_rstat.rfiles;
+  if (dir.is_projected())
+    out << "|" << dir.get_projected_fnode()->rstat.rfiles
+       << "/" << dir.get_projected_fnode()->accounted_rstat.rfiles;
   out << " rd=" << dir.fnode.rstat.rsubdirs << "/" << dir.fnode.accounted_rstat.rsubdirs;
+  if (dir.is_projected())
+    out << "|" << dir.get_projected_fnode()->rstat.rsubdirs
+       << "/" << dir.get_projected_fnode()->accounted_rstat.rsubdirs;
 
   out << " hs=" << dir.get_num_head_items() << "+" << dir.get_num_head_null();
   out << ",ss=" << dir.get_num_snap_items() << "+" << dir.get_num_snap_null();
index 4112be7202e48bb3abcc521bd4264bd5aa5ac154..fc7c915f66b8907d8b30a5718bab6e8ec3c070fc 100644 (file)
@@ -395,6 +395,7 @@ void EMetaBlob::replay(MDS *mds, LogSegment *logseg)
       dout(10) << "EMetaBlob.replay added dir " << *dir << dendl;  
     }
     dir->set_version( lump.fnode.version );
+    dir->fnode = lump.fnode;
 
     if (lump.is_dirty()) {
       dir->_mark_dirty(logseg);