]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: support '~mds{rank number}' for dump tree
authorXiubo Li <xiubli@redhat.com>
Wed, 15 Dec 2021 03:53:34 +0000 (11:53 +0800)
committerXiubo Li <xiubli@redhat.com>
Tue, 18 Jan 2022 01:51:50 +0000 (09:51 +0800)
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 <xiubli@redhat.com>
(cherry picked from commit 6b0bfe2186b78c1dd17b4a21aef56dffdfec73fa)

src/mds/MDCache.cc

index 1b61aadad7fb1fcf64c8e9d660da08e86299bc19..dc4358d3962770b0e07b597d0f3103e2fd5d9057 100644 (file)
@@ -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 {