From 1cf4b7145b6f9e78f926dfa5aa2cc2c88be0aa0e Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Tue, 6 Jan 2009 12:45:49 -0800 Subject: [PATCH] mds: only send clientcaps if we need to revoke, or we can issue explicitly wanted caps --- src/mds/Locker.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/mds/Locker.cc b/src/mds/Locker.cc index 3e5896a32ac5a..7f17a90d56d00 100644 --- a/src/mds/Locker.cc +++ b/src/mds/Locker.cc @@ -633,7 +633,10 @@ bool Locker::issue_caps(CInode *in) << " wanted " << ccap_string(wanted) << dendl; - if (pending != (wanted & allowed)) { + // are there caps that the client _wants_ and can have, but aren't pending? + // or do we need to revoke? + if (((wanted & allowed) & ~pending) || // missing wanted+allowed caps + (pending & ~allowed)) { // need to revoke ~allowed caps. // issue nissued++; -- 2.39.5