Whamcloud - gitweb
LU-5710 all: second batch of corrected typos and grammar errors
[fs/lustre-release.git] / lustre / mdt / mdt_open.c
index 84f0e7e..bdda659 100644 (file)
@@ -511,8 +511,8 @@ static int mdt_finish_open(struct mdt_thread_info *info,
 
        /* LU-2275, simulate broken behaviour (esp. prevalent in
         * pre-2.4 servers where a very strange reply is sent on error
-        * that looks like it was actually almost succesful and a failure at the
-        * same time */
+        * that looks like it was actually almost successful and a
+        * failure at the same time.) */
        if (OBD_FAIL_CHECK(OBD_FAIL_MDS_NEGATIVE_POSITIVE)) {
                mdt_set_disposition(info, rep, DISP_OPEN_OPEN |
                                               DISP_LOOKUP_NEG |
@@ -1063,6 +1063,11 @@ static int mdt_open_by_fid_lock(struct mdt_thread_info *info,
        if (rc)
                GOTO(out, rc);
 
+       /* We should not change file's existing LOV EA */
+       if (S_ISREG(lu_object_attr(&o->mot_obj)) &&
+           flags & MDS_OPEN_HAS_EA && ma->ma_valid & MA_LOV)
+               GOTO(out, rc = -EEXIST);
+
        /* If a release request, check file flags are fine and ask for an
         * exclusive open access. */
        if (flags & MDS_OPEN_RELEASE && !mdt_hsm_release_allow(ma))