mdt_object_unlock(info, obj, ll, 1);
}
- if (ibits == 0)
+ /* Cross-ref case, the lock should be returned to the client */
+ if (ibits == 0 || rc == -EREMOTE)
return;
if (!(open_flags & MDS_OPEN_LOCK) && !(ibits & MDS_INODELOCK_LAYOUT)) {
repbody->valid |= (OBD_MD_FLID | OBD_MD_MDS);
if (rc != 0)
result = rc;
+ else
+ result = -EREMOTE;
GOTO(out_child, result);
}
}
}
EXIT;
out_child:
- mdt_object_open_unlock(info, child, lhc, ibits,
- result == -EREMOTE ? 0 : result);
+ mdt_object_open_unlock(info, child, lhc, ibits, result);
mdt_object_put(info->mti_env, child);
out_parent:
mdt_object_unlock_put(info, parent, lh, result || !created);