From: Jeff Layton Date: Wed, 9 Nov 2016 14:36:07 +0000 (-0500) Subject: client: request journal flush after flushing caps in syncfs X-Git-Tag: v11.1.0~333^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=ccdd778c88002a68756f3b957fd4416703ccaab0;p=ceph.git client: request journal flush after flushing caps in syncfs 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 --- diff --git a/src/client/Client.cc b/src/client/Client.cc index 31522b934b26..9f0517a6b7b3 100644 --- a/src/client/Client.cc +++ b/src/client/Client.cc @@ -4118,18 +4118,26 @@ void Client::flush_caps() ldout(cct, 10) << "flush_caps" << dendl; xlist::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); } }