client: allow xattr caps in inject_release_failure

Because some test environments generate spurious
rmxattr operations, allow the client to release
'X' caps.  Allows xattr operations to proceed
while still preventing client releasing other caps.

Fixes: #9800
Signed-off-by: John Spray <john.spray@redhat.com>
Okay, so you're enumerating the caps you want to be released, which is
xattr shared and exclusive.
Yes, please be explicit about it. :)

On Mon, Oct 27, 2014 at 9:52 AM, John Spray <notifications@github.com>
wrote:

> In src/client/Client.cc:
>
> >      // Simulated bug:
> >      //  - tell the server we think issued is whatever they issued plus whatever we implemented
> >      //  - leave what we have implemented in place
> >      ldout(cct, 20) << __func__ << " injecting failure to release caps" << dendl;
> >      cap->issued = cap->issued | cap->implemented;
> > +
> > +    // Make an exception for revoking xattr caps: we are injecting
> > +    // failure to release other caps, but allow xattr because client
> > +    // will block on xattr ops if it can't release these to MDS (#9800)
> > +    cap->issued ^= (3 << CEPH_CAP_SXATTR) & revoking;
> > +    cap->implemented ^= (3 << CEPH_CAP_SXATTR) & revoking;
>
> Hmm, there's not really an existing constant that shows that
> CEPH_CAP_SXATTR part of a capability is 2 bits wide, is there? One could
> get the three by doing CEPH_CAP_GSHARED | CEPH_CAP_GEXCL I suppose.
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/ceph/ceph/pull/2809/files#r19418297>.
>