From: green Date: Mon, 4 Apr 2005 08:48:17 +0000 (+0000) Subject: Fix quota code problem where on osts objects might be greated with wrong uid/gid X-Git-Tag: v1_8_0_110~486^7~62 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=c0a9c52fd47d57d492e552990e965907f40e83cd;p=fs%2Flustre-release.git Fix quota code problem where on osts objects might be greated with wrong uid/gid --- diff --git a/lustre/osc/osc_quota.c b/lustre/osc/osc_quota.c index e84027b..74777dd 100644 --- a/lustre/osc/osc_quota.c +++ b/lustre/osc/osc_quota.c @@ -87,7 +87,7 @@ static inline struct osc_quota_info *find_qinfo(struct client_obd *cli, for (head = qinfo_hash[hashent].next; head != qinfo_hash+hashent; head = head->next) { oqi = list_entry(head, struct osc_quota_info, oqi_hash); - LASSERT(oqi->oqi_flag = NO_QUOTA); + LASSERT(oqi->oqi_flag == NO_QUOTA); if (oqi->oqi_cli == cli && oqi->oqi_id == id && oqi->oqi_type == type) return oqi; diff --git a/lustre/osc/osc_request.c b/lustre/osc/osc_request.c index 0b75174..fd55e4f 100644 --- a/lustre/osc/osc_request.c +++ b/lustre/osc/osc_request.c @@ -1373,16 +1373,8 @@ static struct ptlrpc_request *osc_build_req(struct client_obd *cli, LASSERT(ops != NULL); ops->ap_fill_obdo(caller_data, cmd, oa); - sort_brw_pages(pga, page_count); - rc = osc_brw_prep_request(cmd, cli->cl_import, oa, NULL, page_count, - pga, &requested_nob, &nio_count, &req); - if (rc != 0) { - CERROR("prep_req failed: %d\n", rc); - GOTO(out, req = ERR_PTR(rc)); - } - /* To enforce quota on oss, we need pass the client's user credit - * information to ost. We chose to store the fsuid and fsgid in + * information to ost. We chose to store the fsuid and fsgid in * oa->o_uid and oa->o_gid since the two fields haven't been used * at present. And we chose one page's user credit information as * the whole rpc's credit information. FIXME */ @@ -1393,6 +1385,14 @@ static struct ptlrpc_request *osc_build_req(struct client_obd *cli, oa->o_gid = ouc.ouc_fsgid; } + sort_brw_pages(pga, page_count); + rc = osc_brw_prep_request(cmd, cli->cl_import, oa, NULL, page_count, + pga, &requested_nob, &nio_count, &req); + if (rc != 0) { + CERROR("prep_req failed: %d\n", rc); + GOTO(out, req = ERR_PTR(rc)); + } + LASSERT(sizeof(*aa) <= sizeof(req->rq_async_args)); aa = (struct osc_brw_async_args *)&req->rq_async_args; aa->aa_oa = oa;