From: Xiubo Li Date: Wed, 15 Dec 2021 03:53:34 +0000 (+0800) Subject: mds: support '~mds{rank number}' for dump tree X-Git-Tag: v16.2.8~236^2~2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=442ade23f8737352c1f3750a56e1357f8df8b980;p=ceph.git 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 (cherry picked from commit 6b0bfe2186b78c1dd17b4a21aef56dffdfec73fa) --- diff --git a/src/mds/MDCache.cc b/src/mds/MDCache.cc index 1b61aadad7fb..dc4358d39627 100644 --- a/src/mds/MDCache.cc +++ b/src/mds/MDCache.cc @@ -8551,10 +8551,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 {