Whamcloud - gitweb
LU-5152 quota: enforce block quota for chgrp
[fs/lustre-release.git] / lustre / osp / osp_object.c
index 0604892..4e316c4 100644 (file)
@@ -709,8 +709,37 @@ static int osp_attr_set(const struct lu_env *env, struct dt_object *dt,
                RETURN(0);
 
        if (!is_only_remote_trans(th)) {
-               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? */
+               }
        } else {
                struct lu_attr  *la;