+ GOTO(out, rc = 0);
+
+ if (valid & LA_FLAGS) {
+ struct lustre_mdt_attrs *lma;
+ struct lu_buf buf;
+
+ if (la->la_flags & LUSTRE_LMA_FL_MASKS) {
+ CLASSERT(sizeof(info->oti_buf) >= sizeof(*lma));
+ lma = (struct lustre_mdt_attrs *)&info->oti_buf;
+ buf.lb_buf = lma;
+ buf.lb_len = sizeof(info->oti_buf);
+ rc = osd_xattr_get(env, &obj->oo_dt, &buf,
+ XATTR_NAME_LMA);
+ if (rc > 0) {
+ lma->lma_incompat =
+ le32_to_cpu(lma->lma_incompat);
+ lma->lma_incompat |=
+ lustre_to_lma_flags(la->la_flags);
+ lma->lma_incompat =
+ cpu_to_le32(lma->lma_incompat);
+ buf.lb_buf = lma;
+ buf.lb_len = sizeof(*lma);
+ rc = osd_xattr_set_internal(env, obj, &buf,
+ XATTR_NAME_LMA,
+ LU_XATTR_REPLACE,
+ oh);
+ }
+ if (rc < 0) {
+ CWARN("%s: failed to set LMA flags: rc = %d\n",
+ osd->od_svname, rc);
+ RETURN(rc);
+ }
+ }
+ }