From 6b0bfe2186b78c1dd17b4a21aef56dffdfec73fa Mon Sep 17 00:00:00 2001 From: Xiubo Li Date: Wed, 15 Dec 2021 11:53:34 +0800 Subject: [PATCH] mds: support '~mds{rank number}' for dump tree The 'get subtrees' command will show the '~mdsdir' as '~mds{rank}' instead. It's strange that 'dump tree ~mds{rank} depth' doesn't work. Signed-off-by: Xiubo Li --- src/mds/MDCache.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/mds/MDCache.cc b/src/mds/MDCache.cc index 315fc137cb3..668517a683b 100644 --- a/src/mds/MDCache.cc +++ b/src/mds/MDCache.cc @@ -8554,10 +8554,12 @@ CInode *MDCache::cache_traverse(const filepath& fp) CInode *in; unsigned depth = 0; + char mdsdir_name[16]; + sprintf(mdsdir_name, "~mds%d", mds->get_nodeid()); if (fp.get_ino()) { in = get_inode(fp.get_ino()); - } else if (fp.depth() > 0 && fp[0] == "~mdsdir") { + } else if (fp.depth() > 0 && (fp[0] == "~mdsdir" || fp[0] == mdsdir_name)) { in = myin; depth = 1; } else { -- 2.47.3