When the client has an excl lock on an inode, and it's
stating a snapped version of it, we can't expect it to
put 2 and 2 together and look at it's head metadata. If
the cap does not follow the snapid we're trying to stat, do
the full rdlock to force the snapped values back to the
mds so we can do the cow.
If there is nothing cow, the cap will get reissued with an
accurate follows value, and we won't have to do this again.
client_t client = mdr->get_client();
int issued = 0;
Capability *cap = ref->get_client_cap(client);
- if (cap)
+ if (cap && (mdr->snapid == CEPH_NOSNAP ||
+ mdr->snapid <= cap->client_follows))
issued = cap->issued();
int mask = req->head.args.getattr.mask;