]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: ensure dirfrags are fetched once 38579/head
authorPatrick Donnelly <pdonnell@redhat.com>
Wed, 9 Dec 2020 20:56:16 +0000 (12:56 -0800)
committerXiubo Li <xiubli@redhat.com>
Wed, 16 Dec 2020 01:18:04 +0000 (09:18 +0800)
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 <pdonnell@redhat.com>
Signed-off-by: Xiubo Li <xiubli@redhat.com>
src/mds/OpenFileTable.cc

index 397462b0646e1572c203621d3f519c91a24a8243..117559361d6ced6ea0f9e9393dcf5899c2439a3d 100644 (file)
@@ -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);