From ccdd778c88002a68756f3b957fd4416703ccaab0 Mon Sep 17 00:00:00 2001 From: Jeff Layton Date: Wed, 9 Nov 2016 09:36:07 -0500 Subject: [PATCH] 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 --- src/client/Client.cc | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/client/Client.cc b/src/client/Client.cc index 31522b934b2..9f0517a6b7b 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); } } -- 2.39.5