struct lu_buf *acl_buf,
struct dt_allocation_hint *hint)
{
+ const struct lu_buf *buf;
int rc;
rc = mdd_declare_object_create_internal(env, p, c, attr, handle, spec,
/* replay case, create LOV EA from client data */
if (spec->no_create ||
(spec->sp_cr_flags & MDS_OPEN_HAS_EA && S_ISREG(attr->la_mode))) {
- const struct lu_buf *buf;
-
buf = mdd_buf_get_const(env, spec->u.sp_ea.eadata,
spec->u.sp_ea.eadatalen);
rc = mdo_declare_xattr_set(env, c, buf, XATTR_NAME_LOV, 0,
if (rc)
GOTO(out, rc);
}
+
+ if (spec->sp_cr_file_secctx_name != NULL) {
+ buf = mdd_buf_get_const(env, spec->sp_cr_file_secctx,
+ spec->sp_cr_file_secctx_size);
+ rc = mdo_declare_xattr_set(env, c, buf,
+ spec->sp_cr_file_secctx_name, 0,
+ handle);
+ if (rc < 0)
+ GOTO(out, rc);
+ }
out:
return rc;
}
struct dt_allocation_hint *hint,
struct thandle *handle)
{
+ const struct lu_buf *buf;
int rc;
mdd_write_lock(env, son, MOR_TGT_CHILD);
if (spec->no_create ||
(S_ISREG(attr->la_mode) && spec->sp_cr_flags & MDS_OPEN_HAS_EA) ||
S_ISDIR(attr->la_mode)) {
- const struct lu_buf *buf;
-
buf = mdd_buf_get_const(env, spec->u.sp_ea.eadata,
spec->u.sp_ea.eadatalen);
rc = mdo_xattr_set(env, son, buf,
GOTO(err_initlized, rc = -EFAULT);
}
+ if (spec->sp_cr_file_secctx_name != NULL) {
+ buf = mdd_buf_get_const(env, spec->sp_cr_file_secctx,
+ spec->sp_cr_file_secctx_size);
+ rc = mdo_xattr_set(env, son, buf, spec->sp_cr_file_secctx_name,
+ 0, handle);
+ if (rc < 0)
+ GOTO(err_initlized, rc);
+ }
+
err_initlized:
if (unlikely(rc != 0)) {
int rc2;