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: v17.1.0~187^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=6b0bfe2186b78c1dd17b4a21aef56dffdfec73fa;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 --- 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 {