/* 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 |
exp->exp_target_data.ted_nodemap);
#endif
- if (info->mti_mdt->mdt_lut.lut_mds_capa &&
- exp_connect_flags(exp) & OBD_CONNECT_MDS_CAPA) {
- struct lustre_capa *capa;
-
- capa = req_capsule_server_get(info->mti_pill, &RMF_CAPA1);
- LASSERT(capa);
- capa->lc_opc = CAPA_OPC_MDS_DEFAULT;
- rc = mo_capa_get(info->mti_env, mdt_object_child(o), capa, 0);
- if (rc)
- RETURN(rc);
- repbody->mbo_valid |= OBD_MD_FLMDSCAPA;
- }
- if (info->mti_mdt->mdt_lut.lut_oss_capa &&
- exp_connect_flags(exp) & OBD_CONNECT_OSS_CAPA &&
- S_ISREG(lu_object_attr(&o->mot_obj))) {
- struct lustre_capa *capa;
-
- capa = req_capsule_server_get(info->mti_pill, &RMF_CAPA2);
- LASSERT(capa);
- capa->lc_opc = CAPA_OPC_OSS_DEFAULT | capa_open_opc(flags);
- rc = mo_capa_get(info->mti_env, mdt_object_child(o), capa, 0);
- if (rc)
- RETURN(rc);
- repbody->mbo_valid |= OBD_MD_FLOSSCAPA;
- }
-
/*
* If we are following a symlink, don't open; and do not return open
* handle for special nodes as client required.
rc = 0;
} else {
if (mdt_object_exists(child)) {
- mdt_set_capainfo(info, 1, rr->rr_fid2,
- BYPASS_CAPA);
mdt_prep_ma_buf_from_rep(info, child, ma);
rc = mdt_attr_get_complex(info, child, ma);
if (rc == 0)
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))
goto out;
mdt_prep_ma_buf_from_rep(info, o, ma);
- mdt_set_capainfo(info, 0, fid, BYPASS_CAPA);
rc = mdt_attr_get_complex(info, o, ma);
if (rc != 0)
GOTO(out, rc);
if (rc)
GOTO(out_child, result = rc);
- mdt_set_capainfo(info, 1, child_fid, BYPASS_CAPA);
if (result == -ENOENT) {
/* Create under OBF and .lustre is not permitted */
if (!fid_is_md_operative(rr->rr_fid1))