From: Patrick Donnelly Date: Wed, 9 Dec 2020 20:56:16 +0000 (-0800) Subject: mds: ensure dirfrags are fetched once X-Git-Tag: v16.1.0~204^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F38579%2Fhead;p=ceph.git mds: ensure dirfrags are fetched once In case the directory was merged but the stale sub directories maybe still kept in the loaded_anchor_map, then it will add the sub directores' parent frag CDir, the merged CDir, into the leaves vector for more than once. Fixes: https://tracker.ceph.com/issues/48517 Signed-off-by: Patrick Donnelly Signed-off-by: Xiubo Li --- diff --git a/src/mds/OpenFileTable.cc b/src/mds/OpenFileTable.cc index 397462b0646e..117559361d6c 100644 --- a/src/mds/OpenFileTable.cc +++ b/src/mds/OpenFileTable.cc @@ -1072,8 +1072,6 @@ void OpenFileTable::_prefetch_dirfrags() } else { frag_vec_t leaves; diri->dirfragtree.get_leaves_under(fg, leaves); - if (leaves.empty()) - leaves.push_back(diri->dirfragtree[fg.value()]); for (auto& leaf : leaves) { if (diri->is_auth()) { dir = diri->get_or_open_dirfrag(mdcache, leaf);