]> Git Repo - linux.git/commitdiff
ceph: don't let check_caps skip sending responses for revoke msgs
authorXiubo Li <[email protected]>
Tue, 27 Jun 2023 23:57:09 +0000 (07:57 +0800)
committerIlya Dryomov <[email protected]>
Fri, 30 Jun 2023 10:08:55 +0000 (12:08 +0200)
If a client sends out a cap update dropping caps with the prior 'seq'
just before an incoming cap revoke request, then the client may drop
the revoke because it believes it's already released the requested
capabilities.

This causes the MDS to wait indefinitely for the client to respond
to the revoke. It's therefore always a good idea to ack the cap
revoke request with the bumped up 'seq'.

Cc: [email protected]
Link: https://tracker.ceph.com/issues/61782
Signed-off-by: Xiubo Li <[email protected]>
Reviewed-by: Milind Changire <[email protected]>
Reviewed-by: Patrick Donnelly <[email protected]>
Signed-off-by: Ilya Dryomov <[email protected]>
fs/ceph/caps.c

index cef91dd5ef832e11536e183230442d7c024eadcd..e2bb0d0072da5adc215d199765ee21a46d478e1f 100644 (file)
@@ -3566,6 +3566,15 @@ static void handle_cap_grant(struct inode *inode,
        }
        BUG_ON(cap->issued & ~cap->implemented);
 
+       /* don't let check_caps skip sending a response to MDS for revoke msgs */
+       if (le32_to_cpu(grant->op) == CEPH_CAP_OP_REVOKE) {
+               cap->mds_wanted = 0;
+               if (cap == ci->i_auth_cap)
+                       check_caps = 1; /* check auth cap only */
+               else
+                       check_caps = 2; /* check all caps */
+       }
+
        if (extra_info->inline_version > 0 &&
            extra_info->inline_version >= ci->i_inline_version) {
                ci->i_inline_version = extra_info->inline_version;
This page took 0.051947 seconds and 4 git commands to generate.