]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: warn, don't crash, on rfiles/rsubdirs underflow
authorSage Weil <sage@newdream.net>
Thu, 12 Nov 2009 18:45:54 +0000 (10:45 -0800)
committerSage Weil <sage@newdream.net>
Thu, 12 Nov 2009 18:45:54 +0000 (10:45 -0800)
This doesn't fix the bug, but lets the mds at least start up.

src/mds/CInode.cc

index cd9fb7004137fdc27b930324d34debfad2998237..1a13310ab3873feccb8744b5fdfb1e7e1ecd0b85 100644 (file)
@@ -1230,8 +1230,22 @@ void CInode::finish_scatter_gather_update(int type)
       }
       pi->rstat.version++;
       dout(20) << " final rstat " << pi->rstat << dendl;
-      assert(pi->rstat.rfiles >= 0);
-      assert(pi->rstat.rsubdirs >= 0);
+
+      //assert(pi->rstat.rfiles >= 0);
+      if (pi->rstat.rfiles < 0) {
+       stringstream ss;
+       ss << "rfiles underflow " << pi->rstat.rfiles << " on " << *this;
+       mdcache->mds->logclient.log(LOG_ERROR, ss);
+       pi->rstat.rfiles = 0;
+      }
+
+      //assert(pi->rstat.rsubdirs >= 0);
+      if (pi->rstat.rsubdirs < 0) {
+       stringstream ss;
+       ss << "rsubdirs underflow " << pi->rstat.rfiles << " on " << *this;
+       mdcache->mds->logclient.log(LOG_ERROR, ss);
+       pi->rstat.rsubdirs = 0;
+      }
     }
     break;