From: dongdong Date: Thu, 8 Jun 2017 09:14:36 +0000 (+0800) Subject: client: signal MDS to flush log when doing a syncfs X-Git-Tag: v12.1.0~73^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F15544%2Fhead;p=ceph.git client: signal MDS to flush log when doing a syncfs Fixes: http://tracker.ceph.com/issues/20129 Signed-off-by: dongdong tao --- diff --git a/src/client/Client.cc b/src/client/Client.cc index 93d348c026b..924bbc10ff9 100644 --- a/src/client/Client.cc +++ b/src/client/Client.cc @@ -5790,7 +5790,8 @@ void Client::_close_sessions() void Client::flush_mdlog_sync() { - + if (mds_requests.empty()) + return; for (map::iterator p = mds_sessions.begin(); p != mds_sessions.end(); ++p) { @@ -5815,9 +5816,9 @@ void Client::unmount() ldout(cct, 2) << "unmounting" << dendl; unmounting = true; + flush_mdlog_sync(); // flush the mdlog for pending requests, if any while (!mds_requests.empty()) { ldout(cct, 10) << "waiting on " << mds_requests.size() << " requests" << dendl; - flush_mdlog_sync(); mount_cond.Wait(client_lock); }