]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: fix incorrect check for if dirfrag is being fragmented 37035/head
authorYan, Zheng <zyan@redhat.com>
Mon, 31 Aug 2020 09:11:09 +0000 (17:11 +0800)
committerNathan Cutler <ncutler@suse.com>
Mon, 7 Sep 2020 20:32:23 +0000 (22:32 +0200)
Fixes: https://tracker.ceph.com/issues/47201
Signed-off-by: "Yan, Zheng" <zyan@redhat.com>
(cherry picked from commit cb2cc228dadf3e5d5cd75835365b91a43c941453)

Conflicts:
src/mds/CDir.cc
- op.stat() takes different kind of null arguments in nautilus, but this
  is not relevant to the backport

src/mds/CDir.cc
src/mds/MDCache.cc

index 4112fdd836f2556476a53a58856eba236735dea6..e657654243def26f57737439bca0dcdaab001b80 100755 (executable)
@@ -2198,7 +2198,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(NULL, (ceph::real_time*) NULL, NULL);
 
       if (!to_set.empty())
@@ -2216,7 +2216,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;
@@ -2237,7 +2237,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(NULL, (ceph::real_time*)NULL, NULL);
 
   /*
index f771ca5455622df2c5b8077c8c731b09d5097838..e18f33635f952e391e8008d10a1b19eeba1ac543 100644 (file)
@@ -11676,6 +11676,8 @@ void MDCache::_fragment_logged(MDRequestRef& mdr)
     CDir *dir = *p;
     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);