]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
client: only set MClientCaps::FLAG_SYNC when flushing dirty auth caps 35118/head
authorJeff Layton <jlayton@redhat.com>
Mon, 6 Apr 2020 16:26:30 +0000 (12:26 -0400)
committerVicente Cheng <freeze.bilsted@gmail.com>
Tue, 19 May 2020 06:11:56 +0000 (06:11 +0000)
Sidharth noticed that we were probably doing more FLAG_SYNC cap flushes
than necessary.

This flag is intended for sync/fsync type activity, and in those cases
all we care about is cleaning dirty caps. We have no need to expedite
other types of cap calls (releases, revokes, etc.).

Fixes: https://tracker.ceph.com/issues/44963
Reported-by: Sidharth Anupkrishnan <sanupkri@redhat.com>
Signed-off-by: Jeff Layton <jlayton@redhat.com>
(cherry picked from commit 63e4ee0e9fe3654dcd680e7e8271870fbd295215)

src/client/Client.cc

index 95b1e6719c726b8398a7e6adf18e28d95a45d2ee..de96f4fe2fa0d0e44376ba3ced61f699ac193a47 100644 (file)
@@ -3610,15 +3610,17 @@ void Client::check_caps(Inode *in, unsigned flags)
     }
 
     int flushing;
+    int msg_flags = 0;
     ceph_tid_t flush_tid;
     if (in->auth_cap == &cap && in->dirty_caps) {
       flushing = mark_caps_flushing(in, &flush_tid);
+      if (flags & CHECK_CAPS_SYNCHRONOUS)
+       msg_flags |= MClientCaps::FLAG_SYNC;
     } else {
       flushing = 0;
       flush_tid = 0;
     }
 
-    int msg_flags = (flags & CHECK_CAPS_SYNCHRONOUS) ? MClientCaps::FLAG_SYNC : 0;
     send_cap(in, session, &cap, msg_flags, cap_used, wanted, retain,
             flushing, flush_tid);
   }