[LTP] [PATCH 06/16] API/cgroup: refuse to mount blkio when io controller is mounted
Li Wang
liwang@redhat.com
Wed Mar 16 11:01:42 CET 2022
On Sat, Mar 5, 2022 at 7:18 AM Luke Nowakowski-Krijger <
luke.nowakowskikrijger@canonical.com> wrote:
> Mounting the v1 blkio controller while v2 io controller is mounted
> unmounts the io controller, triggering a tst_brk that the number of
> controller has gone down.
>
> Because these controllers don't seem to be compatible, tst_brk with
> TCONF and report that we refused to mount the blkio controller while the
> io controller is mounted.
>
> Signed-off-by: Luke Nowakowski-Krijger <
> luke.nowakowskikrijger@canonical.com>
> ---
> lib/tst_cgroup.c | 5 +++++
> 1 file changed, 5 insertions(+)
>
> diff --git a/lib/tst_cgroup.c b/lib/tst_cgroup.c
> index 4e14a2895..52cbf680b 100644
> --- a/lib/tst_cgroup.c
> +++ b/lib/tst_cgroup.c
> @@ -691,6 +691,11 @@ static void cgroup_mount_v1(struct cgroup_ctrl *const
> ctrl)
> char mnt_path[PATH_MAX];
> int made_dir = 0;
>
> + if (ctrl->ctrl_indx == CTRL_BLKIO &&
> controllers[CTRL_IO].ctrl_root) {
> + tst_brk(TCONF,
> + "IO controller found on V2 root, skipping blkio
> mount that would unmount IO controller");
> + }
>
Although we do a TCONF break here, there is still a need to check tst_cgctl
return value in cgroup_require(). Otherwise, test report failure like below:
tst_cgroup.c:702: TCONF: IO controller found on V2 root, skipping blkio
mount that would unmount IO controller
cgroup_fj_function 1 TBROK: cgroup_require: No state was set after call.
Controller 'blkio' maybe does not exist?
> +
> sprintf(mnt_path, "%s%s", cgroup_mount_ltp_prefix,
> ctrl->ctrl_name);
>
> if (!mkdir(mnt_path, 0777)) {
> --
> 2.32.0
>
>
--
Regards,
Li Wang
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.linux.it/pipermail/ltp/attachments/20220316/8e2e5249/attachment.htm>
More information about the ltp
mailing list