]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
client: only set MClientCaps::FLAG_SYNC when flushing dirty auth caps 34997/head
authorJeff Layton <jlayton@redhat.com>
Mon, 6 Apr 2020 16:26:30 +0000 (12:26 -0400)
committerNathan Cutler <ncutler@suse.com>
Mon, 11 May 2020 16:05:40 +0000 (18:05 +0200)
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 d3dceee2e521192cc999d12c0a07a3f336ea1c40..467200d6866b7c75c450cc8b011191a35cdbcabf 100644 (file)
@@ -3623,15 +3623,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);
   }