]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: add config to decide whether to mark dentry bad 50779/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 01:56:59 +0000 (21:56 -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 9476b60aa5d32554c99a522af7edf11125218443..64d711d60c108bcf31e8e081d8a75bd099d021f2 100644 (file)
@@ -949,6 +949,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 a0890289455d51f06204242a85728dc13c14c5be..9846f74856133417137b4f9258d546da9207e6b6 100644 (file)
@@ -693,7 +693,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 */