/* 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 |
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))