]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: add config to decide whether to mark dentry bad 50755/head
authorPatrick Donnelly <pdonnell@redhat.com>
Wed, 29 Mar 2023 13:05:25 +0000 (09:05 -0400)
committerPatrick Donnelly <pdonnell@redhat.com>
Fri, 19 May 2023 16:38:43 +0000 (12:38 -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/mds.yaml.in
src/mds/CDentry.cc

index cf52bed0eb77de9789eb3fdeba85a88d52e66e8d..28814401e542c1f94aad51a3b033735c4051a353 100644 (file)
@@ -968,6 +968,15 @@ options:
   services:
   - mds
   fmt_desc: MDS will abort if dentry is detected newly corrupted.
+- name: mds_go_bad_corrupt_dentry
+  type: bool
+  level: advanced
+  default: true
+  services:
+  - mds
+  fmt_desc: MDS will mark a corrupt dentry as bad and isolate
+  flags:
+  - runtime
 - name: mds_inject_rename_corrupt_dentry_first
   type: float
   level: dev
index 8d79f165768878774b1f6188f78749322551e570..55f2191346fa558c07f8c68711fe37111c8cc96f 100644 (file)
@@ -709,7 +709,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 */