kselftests: cgroup: don't fail on cg_kill_all() error in cg_destroy()

If the cgroup destruction races with an exit() of a belonging
process(es), cg_kill_all() may fail. It's not a good reason to make
cg_destroy() fail and leave the cgroup in place, potentially causing
next test runs to fail.

Signed-off-by: Roman Gushchin <guro@fb.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
Cc: Shuah Khan <shuah@kernel.org>
Cc: kernel-team@fb.com
Cc: linux-kselftest@vger.kernel.org
This commit is contained in:
Roman Gushchin 2019-04-19 10:03:05 -07:00 committed by Tejun Heo
parent 76f969e894
commit ff9fb7cb51
1 changed files with 1 additions and 3 deletions

View File

@ -227,9 +227,7 @@ int cg_destroy(const char *cgroup)
retry:
ret = rmdir(cgroup);
if (ret && errno == EBUSY) {
ret = cg_killall(cgroup);
if (ret)
return ret;
cg_killall(cgroup);
usleep(100);
goto retry;
}