]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: fix incorrect check for if dirfrag is being fragmented 36902/head
authorYan, Zheng <zyan@redhat.com>
Mon, 31 Aug 2020 09:11:09 +0000 (17:11 +0800)
committerYan, Zheng <zyan@redhat.com>
Mon, 31 Aug 2020 09:11:09 +0000 (17:11 +0800)
Fixes: https://tracker.ceph.com/issues/47201
Signed-off-by: "Yan, Zheng" <zyan@redhat.com>
src/mds/CDir.cc
src/mds/MDCache.cc

index 21a4c8e63a7dd50316010dce892651547c3b1266..7061de14442e9b498667ff1e5b6ac680e9eed882 100755 (executable)
@@ -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);
 
   /*
index 51d0db0c7cae91d7a4fdcf6525bb95e5f2d0cb73..678d80d8556fd2b41bce470d0443835602269845 100644 (file)
@@ -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);