Whamcloud - gitweb
LU-18240 sec: enforce per-nodemap project quota for root 36/56436/11
authorSebastien Buisson <sbuisson@ddn.com>
Fri, 20 Sep 2024 06:41:32 +0000 (08:41 +0200)
committerOleg Drokin <green@whamcloud.com>
Sun, 2 Feb 2025 06:25:44 +0000 (06:25 +0000)
commit2686838fefabba038c5a8192b84bfb375391ab14
treeeec1a72690ed0ada6e407663d3097762dd1f337b
parent00e21d59b0a92de5fc22ee331828d0ec4de3403e
LU-18240 sec: enforce per-nodemap project quota for root

Add a new 'ignore_root_prjquota' rbac role on nodemaps, enabled by
default. When not present, project quota for root is enforced for
clients part of this nodemap.

The tricky part is to find a way to pass this nodemap-related
information to the quota enforcement code. On the data path, this is
put in the transaction handle in a field 'th_ignore_root_proj_quota'
when ofd_trans_create() is called. Then the OSD layer is able to put
it in a field 'lqi_ignore_root_proj_quota' of struct lquota_id_info,
so that it can be checked by the QSD handler.
On the metadata path, it needs one more intermediate step as the MDD
layer does not have access to the client export to retrieve the
nodemap. So a new field 'uc_rbac_ignore_root_prjquota' is added to
struct lu_ucred. It is set in ucred_set_rbac_roles(), and used in
mdd_trans_create() to put the value in the transaction handle.

Signed-off-by: Sebastien Buisson <sbuisson@ddn.com>
Change-Id: I71292fb76cbc6476b8ead83bf7a686fd1b03611e
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/56436
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Marc Vef <mvef@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
23 files changed:
lustre/doc/lctl-nodemap-modify.8
lustre/include/dt_object.h
lustre/include/lustre_nodemap.h
lustre/include/lustre_quota.h
lustre/include/md_object.h
lustre/include/uapi/linux/lustre/lustre_idl.h
lustre/lod/lod_sub_object.c
lustre/mdd/mdd_trans.c
lustre/mdt/mdt_coordinator.c
lustre/mdt/mdt_handler.c
lustre/mdt/mdt_lib.c
lustre/mdt/mdt_restripe.c
lustre/obdecho/echo_client.c
lustre/ofd/ofd_trans.c
lustre/osd-ldiskfs/osd_handler.c
lustre/osd-ldiskfs/osd_quota.c
lustre/osd-zfs/osd_object.c
lustre/osd-zfs/osd_quota.c
lustre/ptlrpc/wiretest.c
lustre/quota/qsd_handler.c
lustre/tests/sanity-quota.sh
lustre/utils/wirecheck.c
lustre/utils/wiretest.c