/* the open lock or the lock for cross-ref object should be
* returned to the client */
- if (rc == -EREMOTE || mdt_get_disposition(rep, DISP_OPEN_LOCK)) {
+ if (rc == -MDT_EREMOTE_OPEN || mdt_get_disposition(rep, DISP_OPEN_LOCK)) {
LASSERT(lustre_handle_is_used(&lhc->mlh_reg_lh));
rep->lock_policy_res2 = 0;
rc = mdt_intent_lock_replace(info, lockp, lhc, flags);
MDT_CROSS_LOCK
};
+/* Special magical errno for communicaiton between mdt_reint_open()
+ * and mdt_intent_reint() which means return the lock to the client
+ * for subsequent cross ref open. Previously we used plain -EREMOTE
+ * but other functions called in that path might return it too and
+ * confuse us. This is not returned to the client. See LU-5370. */
+#define MDT_EREMOTE_OPEN (EREMOTE + 1024)
+
struct mdt_reint_record {
mdt_reint_t rr_opcode;
const struct lustre_handle *rr_handle;
up_read(&obj->mot_open_sem);
/* Cross-ref case, the lock should be returned to the client */
- if (ibits == 0 || rc == -EREMOTE)
+ if (ibits == 0 || rc == -MDT_EREMOTE_OPEN)
RETURN_EXIT;
if (!(open_flags & MDS_OPEN_LOCK) && !(ibits & MDS_INODELOCK_LAYOUT)) {
if (rc != 0)
result = rc;
else
- result = -EREMOTE;
+ result = -MDT_EREMOTE_OPEN;
GOTO(out_child, result);
} else if (mdt_object_exists(child)) {
/* We have to get attr & LOV EA & HSM for this