if (IS_ERR(th))
GOTO(out, rc = PTR_ERR(th));
+ if (oa->o_valid & OBD_MD_FLFLAGS && oa->o_flags & LUSTRE_ENCRYPT_FL) {
+ /* punch must be aware we are dealing with an encrypted file */
+ la->la_valid |= LA_FLAGS;
+ la->la_flags |= LUSTRE_ENCRYPT_FL;
+ }
rc = dt_declare_attr_set(env, dob, la, th);
if (rc)
GOTO(stop, rc);
GOTO(unlock, rc);
}
- if (oa->o_valid & OBD_MD_FLFLAGS && oa->o_flags & LUSTRE_ENCRYPT_FL) {
- /* punch must be aware we are dealing with an encrypted file */
- struct lu_attr la = {
- .la_valid = LA_FLAGS,
- .la_flags = LUSTRE_ENCRYPT_FL,
- };
-
- rc = dt_attr_set(env, dob, &la, th);
- if (rc)
- GOTO(unlock, rc);
- }
rc = dt_punch(env, dob, start, OBD_OBJECT_EOF, th);
if (rc)
GOTO(unlock, rc);