Skip to content

Commit

Permalink
kselftests: cgroup: don't fail on cg_kill_all() error in cg_destroy()
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Tejun Heo <[email protected]>
Cc: Shuah Khan <[email protected]>
Cc: [email protected]
Cc: [email protected]
  • Loading branch information
rgushchin authored and htejun committed Apr 19, 2019
1 parent 76f969e commit ff9fb7c
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions tools/testing/selftests/cgroup/cgroup_util.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit ff9fb7c

Please sign in to comment.