From: John Spray Date: Thu, 30 Apr 2015 10:42:12 +0000 (+0100) Subject: mds: handle corrupt dentry more cleanly X-Git-Tag: v9.0.2~217^2~5 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=7252975ef873e62344909feb08046f700908ba22;p=ceph.git mds: handle corrupt dentry more cleanly 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 --- diff --git a/src/mds/CDir.cc b/src/mds/CDir.cc index f17740eb79d..64564809c46 100644 --- a/src/mds/CDir.cc +++ b/src/mds/CDir.cc @@ -1773,8 +1773,14 @@ void CDir::_omap_fetched(bufferlist& hdrbl, map& 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) {