If the __setattrx() fails it will leave the CEPH_CAP_FILE_WR caps reference kept. The tracker is https://tracker.ceph.com/issues/58717.
*** Bug 2182616 has been marked as a duplicate of this bug. ***
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory (Moderate: Red Hat Ceph Storage 6.1 security and bug fix update), and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHSA-2023:3623