[LTP] [PATCH v4 2/3] tst_cgroup: Add safe_cg_open and safe_cg_fchown functions

Richard Palethorpe rpalethorpe@suse.de
Fri Aug 26 07:54:26 CEST 2022


Hello,

Yang Xu <xuyang2018.jy@fujitsu.com> writes:

> safe_cg_open is used to open the sub controller's file ie cgroup.procs
> and returns the opened fd number. The opened fd array is stored in
> fds argument.
>
> safe_cg_fchown is used to use fchownat to change file's uid and gid.
>
> Reviewed-by: Richard Palethorpe <rpalethorpe@suse.com>
> Signed-off-by: Yang Xu <xuyang2018.jy@fujitsu.com>
> ---
>  include/tst_cgroup.h | 21 +++++++++++++++++++++
>  lib/tst_cgroup.c     | 41 +++++++++++++++++++++++++++++++++++++++++
>  2 files changed, 62 insertions(+)
>
> diff --git a/include/tst_cgroup.h b/include/tst_cgroup.h
> index d06847cc6..db959380f 100644
> --- a/include/tst_cgroup.h
> +++ b/include/tst_cgroup.h
> @@ -89,6 +89,9 @@ enum tst_cg_ver {
>  	TST_CG_V2 = 2,
>  };
>  
> +/* This value is equal to ROOTS_MAX in tst_cgroup.c. */
> +#define TST_CG_ROOTS_MAX 32

Thanks, pushed with small change to this comment. Because
TST_CG_ROOTS_MAX is actually greater than ROOTS_MAX.

-- 
Thank you,
Richard.


More information about the ltp mailing list