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:
committed by
Tejun Heo
parent
76f969e894
commit
ff9fb7cb51
@ -227,9 +227,7 @@ int cg_destroy(const char *cgroup)
|
|||||||
retry:
|
retry:
|
||||||
ret = rmdir(cgroup);
|
ret = rmdir(cgroup);
|
||||||
if (ret && errno == EBUSY) {
|
if (ret && errno == EBUSY) {
|
||||||
ret = cg_killall(cgroup);
|
cg_killall(cgroup);
|
||||||
if (ret)
|
|
||||||
return ret;
|
|
||||||
usleep(100);
|
usleep(100);
|
||||||
goto retry;
|
goto retry;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user