rc = md_setxattr(sbi->ll_md_exp, ll_inode2fid(inode),
value ? OBD_MD_FLXATTR : OBD_MD_FLXATTRRM,
name, value, value_size, 0, 0, &req);
+ if (!rc)
+ ll_i2info(inode)->lli_synced_to_mds = false;
ptlrpc_req_finished(req);
out_value:
}
}
- err = md_fsync(ll_i2sbi(inode)->ll_md_exp, ll_inode2fid(inode), &req);
- if (!rc)
- rc = err;
- if (!err)
- ptlrpc_req_finished(req);
+ if (S_ISREG(inode->i_mode) && !lli->lli_synced_to_mds) {
+ /*
+ * only the first sync on MDS makes sense,
+ * everything else is stored on OSTs
+ */
+ err = md_fsync(ll_i2sbi(inode)->ll_md_exp,
+ ll_inode2fid(inode), &req);
+ if (!rc)
+ rc = err;
+ if (!err) {
+ lli->lli_synced_to_mds = true;
+ ptlrpc_req_finished(req);
+ }
+ }
if (S_ISREG(inode->i_mode)) {
struct ll_file_data *fd = file->private_data;
s64 lli_ctime;
s64 lli_btime;
spinlock_t lli_agl_lock;
+ bool lli_synced_to_mds;
/* inode specific open lock caching threshold */
u32 lli_open_thrsh_count;
rc = ll_md_setattr(dentry, op_data);
if (rc)
GOTO(out, rc);
+ lli->lli_synced_to_mds = false;
if (!S_ISREG(inode->i_mode) || hsm_import)
GOTO(out, rc = 0);
}
RETURN(rc);
}
+ ll_i2info(inode)->lli_synced_to_mds = false;
ptlrpc_req_finished(req);