If we receive new caps from the auth MDS and the non-auth MDS is
revoking the newly issued caps, we should release the caps from
the non-auth MDS. The scenario is filelock's state changes from
SYNC to LOCK. Non-auth MDS revokes Fc cap, the client gets Fc cap
from the auth MDS at the same time.
Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
<< " on " << *in
<< dendl;
+ if ((issued & ~old_caps) && in->auth_cap == cap) {
+ // non-auth MDS is revoking the newly grant caps ?
+ for (map<int,Cap*>::iterator it = in->caps.begin(); it != in->caps.end(); ++it) {
+ if (it->second == cap)
+ continue;
+ if (it->second->implemented & ~it->second->issued & issued) {
+ check_caps(in, true);
+ break;
+ }
+ }
+ }
+
if (issued & ~old_caps)
signal_cond_list(in->waitfor_caps);
}
ldout(cct, 10) << " grant, new caps are " << ccap_string(new_caps & ~old_caps) << dendl;
cap->issued = new_caps;
cap->implemented |= new_caps;
+
+ if (cap == in->auth_cap) {
+ // non-auth MDS is revoking the newly grant caps ?
+ for (map<int,Cap*>::iterator it = in->caps.begin(); it != in->caps.end(); ++it) {
+ if (it->second == cap)
+ continue;
+ if (it->second->implemented & ~it->second->issued & new_caps) {
+ check = true;
+ break;
+ }
+ }
+ }
}
if (check)