]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
client: request journal flush after flushing caps in syncfs
authorJeff Layton <jlayton@redhat.com>
Wed, 9 Nov 2016 14:36:07 +0000 (09:36 -0500)
committerJeff Layton <jlayton@redhat.com>
Fri, 11 Nov 2016 11:28:50 +0000 (06:28 -0500)
Ensure that we ask the MDS to flush the journal on the last cap flush
from sync_fs and umount codepaths.

Signed-off-by: Jeff Layton <jlayton@redhat.com>
src/client/Client.cc

index 31522b934b2665ae91f46cf8bb7d775f64c0e4e0..9f0517a6b7b330b0a1d341e3002f6ab1bf46df50 100644 (file)
@@ -4118,18 +4118,26 @@ void Client::flush_caps()
   ldout(cct, 10) << "flush_caps" << dendl;
   xlist<Inode*>::iterator p = delayed_caps.begin();
   while (!p.end()) {
+    unsigned flags = CHECK_CAPS_NODELAY;
     Inode *in = *p;
+
     ++p;
     delayed_caps.pop_front();
-    check_caps(in, CHECK_CAPS_NODELAY);
+    if (p.end() && cap_list.empty())
+      flags |= CHECK_CAPS_SYNCHRONOUS;
+    check_caps(in, flags);
   }
 
   // other caps, too
   p = cap_list.begin();
   while (!p.end()) {
+    unsigned flags = CHECK_CAPS_NODELAY;
     Inode *in = *p;
+
     ++p;
-    check_caps(in, CHECK_CAPS_NODELAY);
+    if (p.end())
+      flags |= CHECK_CAPS_SYNCHRONOUS;
+    check_caps(in, flags);
   }
 }