From 5c74fad0e21365d7e3468bc9b7c7a9cbd12e910d Mon Sep 17 00:00:00 2001 From: Jeff Layton Date: Mon, 6 Apr 2020 12:26:30 -0400 Subject: [PATCH] client: only set MClientCaps::FLAG_SYNC when flushing dirty auth caps 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 Signed-off-by: Jeff Layton (cherry picked from commit 63e4ee0e9fe3654dcd680e7e8271870fbd295215) --- src/client/Client.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/client/Client.cc b/src/client/Client.cc index d3dceee2e5211..467200d6866b7 100644 --- a/src/client/Client.cc +++ b/src/client/Client.cc @@ -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); } -- 2.39.5