- rc = ll_inode_getattr(inode, oa);
- if (rc == -ENOENT) {
- oa->o_valid = 0;
- CDEBUG(D_INODE, "objid "LPX64" is already destroyed\n",
- lli->lli_smd->lsm_object_id);
- } else if (rc) {
- CERROR("inode_getattr failed (%d): unable to send a "
- "Size-on-MDS attribute update for inode %lu/%u\n",
- rc, inode->i_ino, inode->i_generation);
- GOTO(out, rc);
+
+ old_flags = op_data->op_flags;
+ op_data->op_flags = MF_SOM_CHANGE;
+
+ /* If inode is already in another epoch, skip getattr from OSTs. */
+ if (lli->lli_ioepoch == op_data->op_ioepoch) {
+ rc = ll_inode_getattr(inode, oa, op_data->op_ioepoch,
+ old_flags & MF_GETATTR_LOCK);
+ if (rc) {
+ oa->o_valid = 0;
+ if (rc == -ENOENT)
+ CDEBUG(D_INODE, "objid "LPX64" is destroyed\n",
+ lli->lli_smd->lsm_object_id);
+ else
+ CERROR("inode_getattr failed (%d): unable to "
+ "send a Size-on-MDS attribute update "
+ "for inode %lu/%u\n", rc, inode->i_ino,
+ inode->i_generation);
+ } else {
+ CDEBUG(D_INODE, "Size-on-MDS update on "DFID"\n",
+ PFID(&lli->lli_fid));
+ }
+ /* Install attributes into op_data. */
+ md_from_obdo(op_data, oa, oa->o_valid);