]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: handle corrupt dentry more cleanly
authorJohn Spray <john.spray@redhat.com>
Thu, 30 Apr 2015 10:42:12 +0000 (11:42 +0100)
committerJohn Spray <john.spray@redhat.com>
Fri, 1 May 2015 12:00:57 +0000 (13:00 +0100)
Calling damaged() on the rank is overkill, but until
we have a mechanism to selectively handle damaged
paths, it's better than killing the daemon.

Signed-off-by: John Spray <john.spray@redhat.com>
src/mds/CDir.cc

index f17740eb79dc92cf651dac65bceef7d3a2f2e300..64564809c461170ed617b229be3484562bb191a7 100644 (file)
@@ -1773,8 +1773,14 @@ void CDir::_omap_fetched(bufferlist& hdrbl, map<string, bufferlist>& omap,
        }
       }
     } else {
-      dout(1) << "corrupt directory, i got tag char '" << type << "' pos " << pos << dendl;
-      assert(0);
+      dout(1) << "corrupt directory, i got tag char '" << type << "' pos "
+        << pos << dendl;
+      cache->mds->clog->error() << "Corrupt directory entry '" << p->first
+        << "' in dirfrag " << *this;
+      // TODO: add a mechanism for selectively marking a path
+      // damaged, rather than marking the whole rank damaged.
+      cache->mds->damaged();
+      assert(0);  // Unreachable: damaged() respawns us
     }
     
     if (dn && want_dn.length() && want_dn == dname) {