]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: fix incorrect check for if dirfrag is being fragmented 37034/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:56 +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 octopus, but this
  is not relevant to the backport
- newline was missing at the very end of the file: added it

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

index 6c8a0a125fd00031bcfb2411b8364521d580c54e..62234fb3814c03a42e919b48f1d8c1de43dbf8a7 100755 (executable)
@@ -2212,7 +2212,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())
@@ -2230,7 +2230,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;
@@ -2251,7 +2251,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);
 
   /*
@@ -3549,4 +3549,4 @@ bool CDir::should_split_fast() const
 }
 
 MEMPOOL_DEFINE_OBJECT_FACTORY(CDir, co_dir, mds_co);
-MEMPOOL_DEFINE_OBJECT_FACTORY(CDir::scrub_info_t, scrub_info_t, mds_co)
\ No newline at end of file
+MEMPOOL_DEFINE_OBJECT_FACTORY(CDir::scrub_info_t, scrub_info_t, mds_co)
index 88eece19f00bb485c42581b7cc838641626986bd..eacb3ec10ae2296a2aabf46b123b4d1977c8071e 100644 (file)
@@ -11995,6 +11995,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);