Fixes: http://tracker.ceph.com/issues/20129
Signed-off-by: dongdong tao <tdd21151186@gmail.com>
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) {
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);
}