- rc = osp_sync_add(env, o, MDS_SETATTR64_REC, th, attr);
- /* XXX: send new uid/gid to OST ASAP? */
+ if (attr->la_flags & LUSTRE_SET_SYNC_FL) {
+ struct ptlrpc_request *req = NULL;
+ struct osp_update_request *update = NULL;
+ struct osp_device *osp = lu2osp_dev(dt->do_lu.lo_dev);
+
+ update = osp_update_request_create(&osp->opd_dt_dev);
+ if (IS_ERR(update))
+ RETURN(PTR_ERR(update));
+
+ rc = osp_update_rpc_pack(env, attr_set, update,
+ OUT_ASTTR_SET,
+ lu_object_fid(&dt->do_lu),
+ attr);
+ if (rc != 0) {
+ CERROR("%s: update error "DFID": rc = %d\n",
+ osp->opd_obd->obd_name,
+ PFID(lu_object_fid(&dt->do_lu)), rc);
+
+ osp_update_request_destroy(env, update);
+ RETURN(rc);
+ }
+
+ rc = osp_remote_sync(env, osp, update, &req);
+ if (req != NULL)
+ ptlrpc_req_finished(req);
+
+ osp_update_request_destroy(env, update);
+ } else {
+ rc = osp_sync_add(env, o, MDS_SETATTR64_REC, th, attr);
+ /* XXX: send new uid/gid to OST ASAP? */
+ }