From b20ea4302fd279d9a15277a71979f10efdf7b016 Mon Sep 17 00:00:00 2001 From: "Yan, Zheng" Date: Thu, 28 May 2015 17:38:18 +0800 Subject: [PATCH] client: start flushing dirty caps in Client::_fsync() Client::flush_caps(Inode *, MetaSession *) does not start flushing dirty caps. It only re-send caps message for caps that are already being flushed. Signed-off-by: Yan, Zheng --- src/client/Client.cc | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/src/client/Client.cc b/src/client/Client.cc index a1305566a48c..7016c0fd5184 100644 --- a/src/client/Client.cc +++ b/src/client/Client.cc @@ -7728,15 +7728,11 @@ int Client::_fsync(Fh *f, bool syncdataonly) } if (!syncdataonly && (in->dirty_caps & ~CEPH_CAP_ANY_FILE_WR)) { - for (map::iterator iter = in->caps.begin(); iter != in->caps.end(); ++iter) { - if (iter->second->implemented & ~CEPH_CAP_ANY_FILE_WR) { - MetaSession *session = mds_sessions[iter->first]; - assert(session); - flush_caps(in, session); - } + check_caps(in, true); + if (in->flushing_caps) { + flushed_metadata = true; + memcpy(wait_on_flush, in->flushing_cap_tid, sizeof(wait_on_flush)); } - flushed_metadata = true; - memcpy(wait_on_flush, in->flushing_cap_tid, sizeof(wait_on_flush)); } else ldout(cct, 10) << "no metadata needs to commit" << dendl; if (object_cacher_completion) { // wait on a real reply instead of guessing -- 2.47.3