]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
client: signal MDS to flush log when doing a syncfs 15544/head
authordongdong <tdd21151186@gmail.com>
Thu, 8 Jun 2017 09:14:36 +0000 (17:14 +0800)
committerdongdong <tdd21151186@gmail.com>
Mon, 19 Jun 2017 13:49:15 +0000 (21:49 +0800)
Fixes: http://tracker.ceph.com/issues/20129
Signed-off-by: dongdong tao <tdd21151186@gmail.com>
src/client/Client.cc

index 93d348c026b378d9a487bd8516ab6f97b65290fb..924bbc10ff9ecc3ba1f0f95ca72aacb23341a622 100644 (file)
@@ -5790,7 +5790,8 @@ void Client::_close_sessions()
 
 void Client::flush_mdlog_sync()
 {
-
+  if (mds_requests.empty()) 
+    return;
   for (map<mds_rank_t,MetaSession*>::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);
   }