]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
ceph: move mdlog flush to scatter_writebehind() 46423/head
authorXiubo Li <xiubli@redhat.com>
Fri, 4 Mar 2022 07:10:46 +0000 (15:10 +0800)
committerXiubo Li <xiubli@redhat.com>
Mon, 30 May 2022 06:54:37 +0000 (14:54 +0800)
Signed-off-by: Xiubo Li <xiubli@redhat.com>
(cherry picked from commit d41359a47e9f068de7f2e7e0cce99888abbf4069)

src/mds/Locker.cc

index 58b3723dc0b2b394a2807b6a0d344205df3eec50..41119d3800fcd7da1a8d87870950821fb2a0f160 100644 (file)
@@ -1198,7 +1198,6 @@ void Locker::eval_gather(SimpleLock *lock, bool first, bool *pneed_issue, MDSCon
 
       if (lock->is_dirty() && !lock->is_flushed()) {
        scatter_writebehind(static_cast<ScatterLock *>(lock));
-       mds->mdlog->flush();
        return;
       }
       lock->clear_flushed();
@@ -4684,7 +4683,6 @@ bool Locker::simple_sync(SimpleLock *lock, bool *need_issue)
     if (!gather && lock->is_dirty()) {
       lock->get_parent()->auth_pin(lock);
       scatter_writebehind(static_cast<ScatterLock*>(lock));
-      mds->mdlog->flush();
       return false;
     }
 
@@ -4843,7 +4841,6 @@ void Locker::simple_lock(SimpleLock *lock, bool *need_issue)
   if (!gather && lock->is_dirty()) {
     lock->get_parent()->auth_pin(lock);
     scatter_writebehind(static_cast<ScatterLock*>(lock));
-    mds->mdlog->flush();
     return;
   }
 
@@ -4985,6 +4982,7 @@ void Locker::scatter_writebehind(ScatterLock *lock)
   in->finish_scatter_gather_update_accounted(lock->get_type(), &le->metablob);
 
   mds->mdlog->submit_entry(le, new C_Locker_ScatterWB(this, lock, mut));
+  mds->mdlog->flush();
 }
 
 void Locker::scatter_writebehind_finish(ScatterLock *lock, MutationRef& mut)