Skip to content

Commit 7ffa065

Browse files
committed
mds: add config to decide whether to mark dentry bad
So admin can restore access to files if necessary. Signed-off-by: Patrick Donnelly <[email protected]>
1 parent 1b4d907 commit 7ffa065

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

src/common/options/mds.yaml.in

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -959,6 +959,15 @@ options:
959959
services:
960960
- mds
961961
fmt_desc: MDS will abort if dentry is detected newly corrupted.
962+
- name: mds_go_bad_corrupt_dentry
963+
type: bool
964+
level: advanced
965+
default: true
966+
services:
967+
- mds
968+
fmt_desc: MDS will mark a corrupt dentry as bad and isolate
969+
flags:
970+
- runtime
962971
- name: mds_inject_rename_corrupt_dentry_first
963972
type: float
964973
level: dev

src/mds/CDentry.cc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -709,7 +709,9 @@ bool CDentry::check_corruption(bool load)
709709
} else {
710710
derr << "newly corrupt dentry to be committed: " << *this << dendl;
711711
}
712-
dir->go_bad_dentry(last, get_name());
712+
if (g_conf().get_val<bool>("mds_go_bad_corrupt_dentry")) {
713+
dir->go_bad_dentry(last, get_name());
714+
}
713715
if (!load && g_conf().get_val<bool>("mds_abort_on_newly_corrupt_dentry")) {
714716
dir->mdcache->mds->clog->error() << "MDS abort because newly corrupt dentry to be committed: " << *this;
715717
ceph_abort("detected newly corrupt dentry"); /* avoid writing out newly corrupted dn */

0 commit comments

Comments
 (0)