From: Yan, Zheng Date: Mon, 31 Aug 2020 09:11:09 +0000 (+0800) Subject: mds: fix incorrect check for if dirfrag is being fragmented X-Git-Tag: v16.1.0~1199^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=cb2cc228dadf3e5d5cd75835365b91a43c941453;p=ceph.git mds: fix incorrect check for if dirfrag is being fragmented Fixes: https://tracker.ceph.com/issues/47201 Signed-off-by: "Yan, Zheng" --- diff --git a/src/mds/CDir.cc b/src/mds/CDir.cc index 21a4c8e63a7d..7061de14442e 100755 --- a/src/mds/CDir.cc +++ b/src/mds/CDir.cc @@ -2240,7 +2240,7 @@ void CDir::_omap_commit(int op_prio) op.priority = op_prio; // don't create new dirfrag blindly - if (!is_new() && !state_test(CDir::STATE_FRAGMENTING)) + if (!is_new()) op.stat(nullptr, nullptr, nullptr); if (!to_set.empty()) @@ -2258,7 +2258,7 @@ void CDir::_omap_commit(int op_prio) } }; - if (state_test(CDir::STATE_FRAGMENTING)) { + if (state_test(CDir::STATE_FRAGMENTING) && is_new()) { assert(committed_version == 0); for (auto p = items.begin(); p != items.end(); ) { CDentry *dn = p->second; @@ -2279,7 +2279,7 @@ void CDir::_omap_commit(int op_prio) op.priority = op_prio; // don't create new dirfrag blindly - if (!is_new() && !state_test(CDir::STATE_FRAGMENTING)) + if (!is_new()) op.stat(nullptr, nullptr, nullptr); /* diff --git a/src/mds/MDCache.cc b/src/mds/MDCache.cc index 51d0db0c7cae..678d80d8556f 100644 --- a/src/mds/MDCache.cc +++ b/src/mds/MDCache.cc @@ -11998,6 +11998,8 @@ void MDCache::_fragment_logged(MDRequestRef& mdr) for (const auto& dir : info.resultfrags) { dout(10) << " storing result frag " << *dir << dendl; + dir->mark_new(mdr->ls); + // freeze and store them too dir->auth_pin(this); dir->state_set(CDir::STATE_FRAGMENTING);