From 616e76317824d9520812dd0cebf9918b8c38f31b Mon Sep 17 00:00:00 2001 From: dongdong Date: Thu, 8 Jun 2017 17:14:36 +0800 Subject: [PATCH] client: signal MDS to flush log when doing a syncfs Fixes: http://tracker.ceph.com/issues/20129 Signed-off-by: dongdong tao --- src/client/Client.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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); } -- 2.39.5