]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: support '~mds{rank number}' for dump tree 44313/head
authorXiubo Li <xiubli@redhat.com>
Wed, 15 Dec 2021 03:53:34 +0000 (11:53 +0800)
committerXiubo Li <xiubli@redhat.com>
Wed, 15 Dec 2021 04:09:35 +0000 (12:09 +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>
src/mds/MDCache.cc

index 315fc137cb3e85640b91654b74a2ce9d225853af..668517a683bd2376b8d2ff0ccdd6345ba286a7c5 100644 (file)
@@ -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 {