Skip to content

Commit 5fb2f98

Browse files
committed
mds: fix dump dir indicate dir is not cached
Example output: $ ceph daemon mds.a dump dir /test-dir [ { "value/bits": "0/0", "status": "dirfrag not in cache" } ] Fixes: https://tracker.ceph.com/issues/63093 Signed-off-by: Jos Collin <[email protected]>
1 parent f64ad44 commit 5fb2f98

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/mds/MDSRank.cc

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3393,8 +3393,14 @@ void MDSRank::command_dump_dir(Formatter *f, const cmdmap_t &cmdmap, std::ostrea
33933393
in->dirfragtree.get_leaves_under(frag_t(), leaves);
33943394
for (const auto& leaf : leaves) {
33953395
CDir *dir = in->get_dirfrag(leaf);
3396-
if (dir)
3396+
if (dir) {
33973397
mdcache->dump_dir(f, dir, dentry_dump);
3398+
} else {
3399+
f->open_object_section("frag");
3400+
f->dump_stream("frag") << leaf;
3401+
f->dump_string("status", "dirfrag not in cache");
3402+
f->close_section();
3403+
}
33983404
}
33993405
f->close_section();
34003406
}

0 commit comments

Comments
 (0)