- if (req_is_replay(req) ||
- (req->rq_export->exp_libclient && create_flags&MDS_OPEN_HAS_EA)) {
- /* This is a replay request or from liblustre with ea. */
- result = mdt_open_by_fid(info, ldlm_rep);
-
- if (result != -ENOENT) {
- if (req->rq_export->exp_libclient &&
- create_flags&MDS_OPEN_HAS_EA)
- GOTO(out, result = 0);
- GOTO(out, result);
- }
- /*
- * We didn't find the correct object, so we need to re-create it
- * via a regular replay.
- */
- if (!(create_flags & MDS_OPEN_CREAT)) {
- DEBUG_REQ(D_ERROR, req,
- "OPEN & CREAT not in open replay.");
- GOTO(out, result = -EFAULT);
- }
- CDEBUG(D_INFO, "Open replay did find object, continue as "
- "regular open\n");
- } else if (rr->rr_namelen == 0 && !info->mti_cross_ref &&
- create_flags & MDS_OPEN_LOCK) {
- result = mdt_open_anon_by_fid(info, ldlm_rep, lhc);
- GOTO(out, result);
- }
+ if (req_is_replay(req) ||
+ (req->rq_export->exp_libclient && create_flags & MDS_OPEN_HAS_EA)) {
+ /* This is a replay request or from liblustre with ea. */
+ result = mdt_open_by_fid(info, ldlm_rep);
+
+ if (result != -ENOENT) {
+ if (req->rq_export->exp_libclient &&
+ create_flags & MDS_OPEN_HAS_EA)
+ GOTO(out, result = 0);
+ GOTO(out, result);
+ }
+ /* We didn't find the correct object, so we need to re-create it
+ * via a regular replay. */
+ if (!(create_flags & MDS_OPEN_CREAT)) {
+ DEBUG_REQ(D_ERROR, req,
+ "OPEN & CREAT not in open replay/by_fid.");
+ GOTO(out, result = -EFAULT);
+ }
+ CDEBUG(D_INFO, "No object(1), continue as regular open.\n");
+ } else if ((rr->rr_namelen == 0 && !info->mti_cross_ref &&
+ create_flags & MDS_OPEN_LOCK) ||
+ (create_flags & MDS_OPEN_BY_FID)) {
+ result = mdt_open_by_fid_lock(info, ldlm_rep, lhc);
+ if (result != -ENOENT && !(create_flags & MDS_OPEN_CREAT))
+ GOTO(out, result);
+ if (unlikely(rr->rr_namelen == 0))
+ GOTO(out, result = -EINVAL);
+ CDEBUG(D_INFO, "No object(2), continue as regular open.\n");
+ }