From: Yan, Zheng Date: Fri, 18 May 2018 06:26:32 +0000 (+0800) Subject: client: fix issue of revoking non-auth caps X-Git-Tag: v13.2.0~26^2 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=2c22252c96987bd30241a4d33b23aead38d89501;p=ceph.git client: fix issue of revoking non-auth caps 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" Fixes: https://tracker.ceph.com/issues/24172 (cherry picked from commit 341a9114e0726e1a7cbb7e6f22adb54c2024c506) --- diff --git a/src/client/Client.cc b/src/client/Client.cc index d87bd1e1bf10c..1db0b58683094 100644 --- a/src/client/Client.cc +++ b/src/client/Client.cc @@ -5103,17 +5103,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 {