- /* locks are compatible, bits don't matter */
- if (lockmode_compat(lock->l_req_mode, req_mode)) {
- /* jump to last lock in mode group */
- tmp = mode_tail;
- continue;
- }
+ /* if reqest lock is not COS_INCOMPAT and COS is disabled,
+ * they are compatible, IOW this request is from a local
+ * transaction on a DNE system. */
+ if (lock->l_req_mode == LCK_COS && !ldlm_is_cos_incompat(req) &&
+ !ldlm_is_cos_enabled(req)) {
+ /* jump to last lock in mode group */
+ tmp = mode_tail;
+ continue;
+ }