]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
client: fix issue of revoking non-auth caps 22221/head
authorYan, Zheng <zyan@redhat.com>
Fri, 18 May 2018 06:26:32 +0000 (14:26 +0800)
committerPrashant D <pdhange@redhat.com>
Thu, 24 May 2018 09:53:48 +0000 (05:53 -0400)
when non-auth mds revokes caps, Fcb caps can still be issued by auth
auth mds. It's wrong to flush buffer or invalidate cache when non-auth
mds revokes other caps. This bug can cause client to not respond the
revoke.

Signed-off-by: "Yan, Zheng" <zyan@redhat.com>
Fixes: https://tracker.ceph.com/issues/24172
(cherry picked from commit 341a9114e0726e1a7cbb7e6f22adb54c2024c506)

src/client/Client.cc

index 044c29f3a08156818acfde4bd481b4a68903d109..37ebef5c93659963f936882de364042535e58551 100644 (file)
@@ -5104,17 +5104,16 @@ void Client::handle_cap_grant(MetaSession *session, Inode *in, Cap *cap, MClient
     else if (revoked & ceph_deleg_caps_for_type(CEPH_DELEGATION_WR))
       in->recall_deleg(true);
 
-    if (((used & ~new_caps) & CEPH_CAP_FILE_BUFFER)
-        && !_flush(in, new C_Client_FlushComplete(this, in))) {
+    if ((used & revoked & CEPH_CAP_FILE_BUFFER) &&
+       !_flush(in, new C_Client_FlushComplete(this, in))) {
       // waitin' for flush
-    } else if ((old_caps & ~new_caps) & CEPH_CAP_FILE_CACHE) {
+    } else if (revoked & CEPH_CAP_FILE_CACHE) {
       if (_release(in))
        check = true;
     } else {
       cap->wanted = 0; // don't let check_caps skip sending a response to MDS
       check = true;
     }
-
   } else if (old_caps == new_caps) {
     ldout(cct, 10) << "  caps unchanged at " << ccap_string(old_caps) << dendl;
   } else {