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

Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
src/common/options/mds.yaml.in
src/mds/CDentry.cc

index cbbc00e41ed78999a3acdfb1cfe46812c4fbea86..ddf2d0860de601b24f62c7063b43606350fa8aab 100644 (file)
@@ -959,6 +959,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 */