From: Yan, Zheng Date: Thu, 28 May 2015 09:38:18 +0000 (+0800) Subject: client: start flushing dirty caps in Client::_fsync() X-Git-Tag: v9.0.2~37^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=b20ea4302fd279d9a15277a71979f10efdf7b016;p=ceph.git 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 --- 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