From: Jeff Layton Date: Fri, 11 Nov 2016 11:28:29 +0000 (-0500) Subject: mds: do mds log flush if CLIENT_CAPS_SYNC is set X-Git-Tag: v11.1.0~333^2~5 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=93954d0e99296c58ef85cd9fdf455e939d5f4fd4;p=ceph.git mds: do mds log flush if CLIENT_CAPS_SYNC is set If the client has set the sync flag in a cap update, then it is indicating that it's waiting on the reply. Ensure that we flush the journal in that case. Signed-off-by: Jeff Layton --- diff --git a/src/mds/Locker.cc b/src/mds/Locker.cc index 64a56af7fd5c..285eebdd3c88 100644 --- a/src/mds/Locker.cc +++ b/src/mds/Locker.cc @@ -2487,7 +2487,9 @@ void Locker::handle_client_caps(MClientCaps *m) client_t client = m->get_source().num(); snapid_t follows = m->get_snap_follows(); - dout(7) << "handle_client_caps on " << m->get_ino() + dout(7) << "handle_client_caps " + << ((m->flags & CLIENT_CAPS_SYNC) ? "sync" : "async") + << " on " << m->get_ino() << " tid " << m->get_client_tid() << " follows " << follows << " op " << ceph_cap_op_name(m->get_op()) << dendl; @@ -2706,10 +2708,10 @@ void Locker::handle_client_caps(MClientCaps *m) } // filter wanted based on what we could ever give out (given auth/replica status) - bool need_flush = false; + bool need_flush = m->flags & CLIENT_CAPS_SYNC; int new_wanted = m->get_wanted() & head_in->get_caps_allowed_ever(); if (new_wanted != cap->wanted()) { - if (new_wanted & ~cap->pending()) { + if (!need_flush && (new_wanted & ~cap->pending())) { // exapnding caps. make sure we aren't waiting for a log flush need_flush = _need_flush_mdlog(head_in, new_wanted & ~cap->pending()); }