Details
-
Bug
-
Resolution: Fixed
-
Major
-
None
-
None
Description
Recently, we had to limit a user on an OST of products (lot of libs in it). But we were not able to do that with TBF. After some tries, we were able to set a limit, but with the GID's owner.
Setting this limit, globally decrease the bandwidth for everybody (all files in the products have the same uid/gid).
The TBF rules on an OST get the uid/gid values from:
static int ost_tbf_id_cli_set(struct ptlrpc_request *req, struct tbf_id *id) struct ost_body *body; ... id->ti_uid = body->oa.o_uid; id->ti_gid = body->oa.o_gid;
These values are filled by the osc here:
int osc_build_rpc(const struct lu_env *env, struct client_obd *cli, struct list_head *ext_list, int cmd) .... crattr->cra_oa = oa; cl_req_attr_set(env, osc2cl(obj), crattr); static int osc_brw_prep_request(int cmd, struct client_obd *cli, struct obdo *oa, u32 page_count, struct brw_page **pga, struct ptlrpc_request **reqp, int resend) ..... lustre_set_wire_obdo(&req->rq_import->imp_connect_data, &body->oa, oa); /* For READ and WRITE, we can't fill o_uid and o_gid using from_kuid() * and from_kgid(), because they are asynchronous. Fortunately, variable * oa contains valid o_uid and o_gid in these two operations. * Besides, filling o_uid and o_gid is enough for nrs-tbf, see LU-9658. * OBD_MD_FLUID and OBD_MD_FLUID is not set in order to avoid breaking * other process logic */ body->oa.o_uid = oa->o_uid; body->oa.o_gid = oa->o_gid;
So the uid/gid use to filter the request came directly from the inode attr.
Attachments
Issue Links
Activity
Resolution | New: Fixed [ 1 ] | |
Status | Original: Reopened [ 4 ] | New: Resolved [ 5 ] |
Priority | Original: Minor [ 4 ] | New: Major [ 3 ] |
Resolution | Original: Fixed [ 1 ] | |
Status | Original: Resolved [ 5 ] | New: Reopened [ 4 ] |
Fix Version/s | New: Lustre 2.16.0 [ 15190 ] | |
Resolution | New: Fixed [ 1 ] | |
Status | Original: Open [ 1 ] | New: Resolved [ 5 ] |
Assignee | Original: WC Triage [ wc-triage ] | New: Etienne Aujames [ eaujames ] |
Description |
Original:
Recently, we had to limit a user on an OST of products (lot of libs in it). But we were not able to do that with TBF. After some tries, we were able to set a limit, but with the GID's owner.
Setting this limit, globally decrease the bandwidth for everybody (all files in the products have the same uid/gid). The TBF rules on an OST get the uid/gid values from: {code:C} static int ost_tbf_id_cli_set(struct ptlrpc_request *req, struct tbf_id *id) struct ost_body *body; ... id->ti_uid = body->oa.o_uid; id->ti_gid = body->oa.o_gid; {code} These values are filled by the osc here: {code: C} int osc_build_rpc(const struct lu_env *env, struct client_obd *cli, struct list_head *ext_list, int cmd) .... crattr->cra_oa = oa; cl_req_attr_set(env, osc2cl(obj), crattr); static int osc_brw_prep_request(int cmd, struct client_obd *cli, struct obdo *oa, u32 page_count, struct brw_page **pga, struct ptlrpc_request **reqp, int resend) ..... lustre_set_wire_obdo(&req->rq_import->imp_connect_data, &body->oa, oa); /* For READ and WRITE, we can't fill o_uid and o_gid using from_kuid() * and from_kgid(), because they are asynchronous. Fortunately, variable * oa contains valid o_uid and o_gid in these two operations. * Besides, filling o_uid and o_gid is enough for nrs-tbf, see * OBD_MD_FLUID and OBD_MD_FLUID is not set in order to avoid breaking * other process logic */ body->oa.o_uid = oa->o_uid; body->oa.o_gid = oa->o_gid; {code} So the uid/gid use to filter the request came directly from the inode attr. |
New:
Recently, we had to limit a user on an OST of products (lot of libs in it). But we were not able to do that with TBF. After some tries, we were able to set a limit, but with the GID's owner.
Setting this limit, globally decrease the bandwidth for everybody (all files in the products have the same uid/gid). The TBF rules on an OST get the uid/gid values from: {code:C} static int ost_tbf_id_cli_set(struct ptlrpc_request *req, struct tbf_id *id) struct ost_body *body; ... id->ti_uid = body->oa.o_uid; id->ti_gid = body->oa.o_gid; {code} These values are filled by the osc here: {code:C} int osc_build_rpc(const struct lu_env *env, struct client_obd *cli, struct list_head *ext_list, int cmd) .... crattr->cra_oa = oa; cl_req_attr_set(env, osc2cl(obj), crattr); static int osc_brw_prep_request(int cmd, struct client_obd *cli, struct obdo *oa, u32 page_count, struct brw_page **pga, struct ptlrpc_request **reqp, int resend) ..... lustre_set_wire_obdo(&req->rq_import->imp_connect_data, &body->oa, oa); /* For READ and WRITE, we can't fill o_uid and o_gid using from_kuid() * and from_kgid(), because they are asynchronous. Fortunately, variable * oa contains valid o_uid and o_gid in these two operations. * Besides, filling o_uid and o_gid is enough for nrs-tbf, see * OBD_MD_FLUID and OBD_MD_FLUID is not set in order to avoid breaking * other process logic */ body->oa.o_uid = oa->o_uid; body->oa.o_gid = oa->o_gid; {code} So the uid/gid use to filter the request came directly from the inode attr. |
Description |
Original:
Recently, we had to limit a user on an OST of products (lot of libs in it). But we were not able to do that with TBF. After some tries, we were able to set a limit, but with the GID's owner.
Setting this limit, globally decrease the bandwidth for everybody (all files in the products have the same uid/gid). The TBF rules on an OST get the uid/gid values from: {noformat} static int ost_tbf_id_cli_set(struct ptlrpc_request *req, struct tbf_id *id) struct ost_body *body; ... id->ti_uid = body->oa.o_uid; id->ti_gid = body->oa.o_gid; {noformat} These values are filled by the osc here: {noformat} int osc_build_rpc(const struct lu_env *env, struct client_obd *cli, struct list_head *ext_list, int cmd) .... crattr->cra_oa = oa; cl_req_attr_set(env, osc2cl(obj), crattr); static int osc_brw_prep_request(int cmd, struct client_obd *cli, struct obdo *oa, u32 page_count, struct brw_page **pga, struct ptlrpc_request **reqp, int resend) ..... lustre_set_wire_obdo(&req->rq_import->imp_connect_data, &body->oa, oa); /* For READ and WRITE, we can't fill o_uid and o_gid using from_kuid() * and from_kgid(), because they are asynchronous. Fortunately, variable * oa contains valid o_uid and o_gid in these two operations. * Besides, filling o_uid and o_gid is enough for nrs-tbf, see * OBD_MD_FLUID and OBD_MD_FLUID is not set in order to avoid breaking * other process logic */ body->oa.o_uid = oa->o_uid; body->oa.o_gid = oa->o_gid; {noformat} So the uid/gid use to filter the request came directly from the inode attr. |
New:
Recently, we had to limit a user on an OST of products (lot of libs in it). But we were not able to do that with TBF. After some tries, we were able to set a limit, but with the GID's owner.
Setting this limit, globally decrease the bandwidth for everybody (all files in the products have the same uid/gid). The TBF rules on an OST get the uid/gid values from: {code:C} static int ost_tbf_id_cli_set(struct ptlrpc_request *req, struct tbf_id *id) struct ost_body *body; ... id->ti_uid = body->oa.o_uid; id->ti_gid = body->oa.o_gid; {code} These values are filled by the osc here: {code: C} int osc_build_rpc(const struct lu_env *env, struct client_obd *cli, struct list_head *ext_list, int cmd) .... crattr->cra_oa = oa; cl_req_attr_set(env, osc2cl(obj), crattr); static int osc_brw_prep_request(int cmd, struct client_obd *cli, struct obdo *oa, u32 page_count, struct brw_page **pga, struct ptlrpc_request **reqp, int resend) ..... lustre_set_wire_obdo(&req->rq_import->imp_connect_data, &body->oa, oa); /* For READ and WRITE, we can't fill o_uid and o_gid using from_kuid() * and from_kgid(), because they are asynchronous. Fortunately, variable * oa contains valid o_uid and o_gid in these two operations. * Besides, filling o_uid and o_gid is enough for nrs-tbf, see * OBD_MD_FLUID and OBD_MD_FLUID is not set in order to avoid breaking * other process logic */ body->oa.o_uid = oa->o_uid; body->oa.o_gid = oa->o_gid; {code} So the uid/gid use to filter the request came directly from the inode attr. |