Re: [PATCH] selftests: cgroup: Fix exception handling in test_memcg_oom_group_score_events()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



>> 2. Can a cg_destroy() call ever work as expected if a cg_create() call failed?
>
> Perhaps next time you can answer your own question by spending 30
> seconds actually reading the code you're "fixing":
>
> int cg_destroy(const char *cgroup)
> {
…
>         ret = rmdir(cgroup);
…
>         if (ret && errno == ENOENT) <<< that case is explicitly handled here
>                 ret = 0;
>
>         return ret;
> }

Is it interesting somehow that a non-existing directory (which would occasionally
not be found) is tolerated so far?
https://elixir.bootlin.com/linux/v6.3-rc3/source/tools/testing/selftests/cgroup/cgroup_util.c#L285

Should such a function call be avoided because of a failed cg_create() call?

Regards,
Markus





[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux