]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: add config to decide whether to mark dentry bad 50781/head
authorPatrick Donnelly <pdonnell@redhat.com>
Wed, 29 Mar 2023 13:05:25 +0000 (09:05 -0400)
committerPatrick Donnelly <pdonnell@redhat.com>
Thu, 30 Mar 2023 12:40:50 +0000 (08:40 -0400)
So admin can restore access to files if necessary.

Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
(cherry picked from commit 7ffa065a03316b67b6b6d48692b4b181f93ddbda)

src/common/options.cc
src/mds/CDentry.cc

index 8b2ff98722815d6b2e1018d8901614cb3ca2e958..381b693983d7a8ab6fbb37e78a5b5abd5eb1024e 100644 (file)
@@ -8688,6 +8688,11 @@ std::vector<Option> get_mds_options() {
     .set_default(true)
     .set_description("MDS will abort if dentry is detected newly corrupted."),
 
+    Option("mds_go_bad_corrupt_dentry", Option::TYPE_BOOL, Option::LEVEL_ADVANCED)
+    .set_default(true)
+    .set_flag(Option::FLAG_RUNTIME)
+    .set_description("MDS will mark a corrupt dentry as bad and isolate"),
+
     Option("mds_inject_rename_corrupt_dentry_first", Option::TYPE_FLOAT, Option::LEVEL_DEV)
     .set_default(0.0)
     .set_flag(Option::FLAG_RUNTIME)
index e6f7b5e54221d892b2ae040615e09178f5d99bf4..a2a7985996a8d4069a23357eafa4c8ca49d20c1a 100644 (file)
@@ -689,7 +689,9 @@ bool CDentry::check_corruption(bool load)
     } else {
       derr << "newly corrupt dentry to be committed: " << *this << dendl;
     }
-    dir->go_bad_dentry(last, get_name());
+    if (g_conf().get_val<bool>("mds_go_bad_corrupt_dentry")) {
+      dir->go_bad_dentry(last, get_name());
+    }
     if (!load && g_conf().get_val<bool>("mds_abort_on_newly_corrupt_dentry")) {
       dir->mdcache->mds->clog->error() << "MDS abort because newly corrupt dentry to be committed: " << *this;
       ceph_abort("detected newly corrupt dentry"); /* avoid writing out newly corrupted dn */