From 3c14b5b4a77e87b540f668999a8759df0bd0d01a Mon Sep 17 00:00:00 2001 From: Patrick Donnelly Date: Wed, 9 Dec 2020 12:56:16 -0800 Subject: [PATCH] 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 --- src/mds/OpenFileTable.cc | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/mds/OpenFileTable.cc b/src/mds/OpenFileTable.cc index 397462b0646..117559361d6 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); -- 2.39.5