GOTO(out_tx, rc);
}
- rc = dt_declare_xattr_set(env, dt_obj, &info->fti_buf,
- XATTR_NAME_FID, 0, th);
- if (rc)
- GOTO(out_tx, rc);
-
+ if (oa->o_valid & (OBD_MD_FLFID | OBD_MD_FLOSTLAYOUT |
+ OBD_MD_LAYOUT_VERSION)) {
+ rc = dt_declare_xattr_set(env, dt_obj, &info->fti_buf,
+ XATTR_NAME_FID, 0, th);
+ if (rc)
+ GOTO(out_tx, rc);
+ }
/* We don't need a transno for this operation which will be re-executed
* anyway when the OST_WRITE (with a transno assigned) is replayed */
rc = dt_trans_start_local(env, ofd->ofd_osd , th);
ofd_read_lock(env, ofd_obj);
+ rc = ofd_attr_handle_id(env, ofd_obj, la, 0 /* !is_setattr */);
+ if (rc != 0)
+ GOTO(out_unlock, rc);
+
+ if (!la->la_valid && !(oa->o_valid &
+ (OBD_MD_FLFID | OBD_MD_FLOSTLAYOUT | OBD_MD_LAYOUT_VERSION)))
+ /* no attributes to set */
+ GOTO(out_unlock, rc = 0);
+
+
+
/* set uid/gid/projid */
if (la->la_valid) {
rc = dt_attr_set(env, dt_obj, la, th);
RETURN(rc);
gid = i_gid_read(obj->oo_inode);
+ CDEBUG(D_QUOTA, "declare uid %d -> %d gid %d -> %d\n", uid,
+ attr->la_uid, gid, attr->la_gid);
enforce = (attr->la_valid & LA_GID) && (attr->la_gid != gid);
- rc = osd_declare_attr_qid(env, obj, oh, bspace,
- i_gid_read(obj->oo_inode),
+ rc = osd_declare_attr_qid(env, obj, oh, bspace, gid,
attr->la_gid, enforce, GRPQUOTA,
ignore_edquot);
if (rc)
(attr->la_valid & LA_GID && attr->la_gid != i_gid_read(inode))) {
struct iattr iattr;
+ CDEBUG(D_QUOTA,
+ "executing dquot_transfer inode %ld uid %d -> %d gid %d -> %d\n",
+ inode->i_ino, i_uid_read(inode), attr->la_uid,
+ i_gid_read(inode), attr->la_gid);
+
dquot_initialize(inode);
iattr.ia_valid = 0;
if (attr->la_valid & LA_UID)
ll_dirty_inode(inode, I_DIRTY_DATASYNC);
+ osd_trans_exec_check(env, handle, OSD_OT_ATTR_SET);
+
if (!(attr->la_valid & LA_FLAGS))
GOTO(out, rc);
lma->lma_incompat |=
lustre_to_lma_flags(attr->la_flags);
lustre_lma_swab(lma);
+
+ osd_trans_exec_op(env, handle, OSD_OT_XATTR_SET);
+
rc = __osd_xattr_set(info, inode, XATTR_NAME_LMA,
lma, sizeof(*lma), XATTR_REPLACE);
if (rc != 0) {
osd_trans_exec_check(env, handle, OSD_OT_XATTR_SET);
}
out:
- osd_trans_exec_check(env, handle, OSD_OT_ATTR_SET);
return rc;
}