]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: don't recreate damaged stray dirfrags
authorJohn Spray <john.spray@redhat.com>
Mon, 1 Jun 2015 21:09:10 +0000 (22:09 +0100)
committerJohn Spray <john.spray@redhat.com>
Thu, 18 Jun 2015 10:19:44 +0000 (11:19 +0100)
Instead of recreating them, go damaged.  Be warned,
the codepath for recreating them by hand doesn't
exist yet (cephfs-data-scan doesn't touch stray
dirs)

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

index 0261749cb13c7316798dd6edd20edbfebabe8696..758c04cc074271c5a3fa1f4557c514cab8e0ec91 100644 (file)
@@ -690,17 +690,8 @@ void MDCache::populate_mydir()
       }
 
       if (dir->state_test(CDir::STATE_BADFRAG)) {
-        // Failed to load, create a fresh one.  We wouldn't do this for
-        // most parts of the hierarchy, but for strays it's the lesser of
-        // evils in order to let the rest of the system start up.
-        // If we have lost stray dentries that contained hardlinked inodes,
-        // that will be scrub/repair's job to fix up.
-        mds->clog->warn() << "fragment " << dir->dirfrag() << " was unreadable, "
-          "recreating it now";
-        LogSegment *ls = mds->mdlog->get_current_segment();
-        dir->state_clear(CDir::STATE_BADFRAG);
-        dir->mark_complete();
-        dir->mark_dirty(dir->pre_dirty(), ls);
+        mds->damaged();
+        assert(0);
       } else if (dir->get_version() == 0) {
         dir->fetch(new C_MDS_RetryOpenRoot(this));
         return;