Skip to content

Commit 257e617

Browse files
lxbszidryomov
authored andcommitted
ceph: don't let check_caps skip sending responses for revoke msgs
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: stable@vger.kernel.org Link: https://tracker.ceph.com/issues/61782 Signed-off-by: Xiubo Li <xiubli@redhat.com> Reviewed-by: Milind Changire <mchangir@redhat.com> Reviewed-by: Patrick Donnelly <pdonnell@redhat.com> Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
1 parent ce72d4e commit 257e617

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

fs/ceph/caps.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3566,6 +3566,15 @@ static void handle_cap_grant(struct inode *inode,
35663566
}
35673567
BUG_ON(cap->issued & ~cap->implemented);
35683568

3569+
/* don't let check_caps skip sending a response to MDS for revoke msgs */
3570+
if (le32_to_cpu(grant->op) == CEPH_CAP_OP_REVOKE) {
3571+
cap->mds_wanted = 0;
3572+
if (cap == ci->i_auth_cap)
3573+
check_caps = 1; /* check auth cap only */
3574+
else
3575+
check_caps = 2; /* check all caps */
3576+
}
3577+
35693578
if (extra_info->inline_version > 0 &&
35703579
extra_info->inline_version >= ci->i_inline_version) {
35713580
ci->i_inline_version = extra_info->inline_version;

0 commit comments

Comments
 (0)