]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: only send clientcaps if we need to revoke, or we can issue explicitly wanted...
authorSage Weil <sage@newdream.net>
Tue, 6 Jan 2009 20:45:49 +0000 (12:45 -0800)
committerSage Weil <sage@newdream.net>
Tue, 6 Jan 2009 20:45:49 +0000 (12:45 -0800)
src/mds/Locker.cc

index 3e5896a32ac5a932a55fb8697b89645d8f74cdd0..7f17a90d56d00943c8a1a06d9b897acb25501c2b 100644 (file)
@@ -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++;