The `get subtrees` will return the path '' for the '0x1', and if
we pass '' to the `dump tree ''` command, the MDS will crash.
Fixes: https://tracker.ceph.com/issues/53726
Signed-off-by: Xiubo Li <xiubli@redhat.com>
(cherry picked from commit
cc80cea0db697ceec7a8c4d5dacc4840e661834e)
std::string root;
int64_t depth;
cmd_getval(cmdmap, "root", root);
+ if (root.empty()) {
+ root = "/";
+ }
if (!cmd_getval(cmdmap, "depth", depth))
depth = -1;
std::lock_guard l(mds_lock);