X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=blobdiff_plain;f=lustre%2Fmdt%2Fmdt_open.c;h=d35526eac867a1f09f1aaa254232c5403aeb9f4d;hp=6a2d5eabc9c69941827b3d7af31bd13730e4ba6a;hb=cb85c0364fd8323f4bb03c481660805da66aaf85;hpb=1490e22dd1bebd043e1b819f89011b1097dcf289 diff --git a/lustre/mdt/mdt_open.c b/lustre/mdt/mdt_open.c index 6a2d5ea..d35526e 100644 --- a/lustre/mdt/mdt_open.c +++ b/lustre/mdt/mdt_open.c @@ -1665,23 +1665,16 @@ int mdt_reint_open(struct mdt_thread_info *info, struct mdt_lock_handle *lhc) GOTO(out, result = -EFAULT); } CDEBUG(D_INFO, "No object(1), continue as regular open.\n"); - } else if ((!lu_name_is_valid(&rr->rr_name) && - (create_flags & MDS_OPEN_LOCK)) || - (create_flags & MDS_OPEN_BY_FID)) { + } else if (create_flags & (MDS_OPEN_BY_FID | MDS_OPEN_LOCK)) { + /* + * MDS_OPEN_LOCK is checked for backward compatibility with 2.1 + * client. + */ result = mdt_open_by_fid_lock(info, ldlm_rep, lhc); - /* If result is 0 then open by FID has found the file - * and there is nothing left for us to do here. More - * generally if it is anything other than -ENOENT or - * -EREMOTE then we return that now. If -ENOENT and - * MDS_OPEN_CREAT is set then we must create the file - * below. If -EREMOTE then we need to return a LOOKUP - * lock to the client, which we do below. Hence this - * odd looking condition. See LU-2523. */ - if (!(result == -ENOENT && (create_flags & MDS_OPEN_CREAT)) && - result != -EREMOTE) - GOTO(out, result); - - CDEBUG(D_INFO, "No object(2), continue as regular open.\n"); + if (result < 0) + CDEBUG(D_INFO, "no object for "DFID": %d\n", + PFID(rr->rr_fid2), result); + GOTO(out, result); } if (OBD_FAIL_CHECK(OBD_FAIL_MDS_OPEN_PACK))