kselftests: cgroup: don't fail on cg_kill_all() error in cg_destroy()
authorRoman Gushchin <guro@fb.com>
Fri, 19 Apr 2019 17:03:05 +0000 (10:03 -0700)
committerTejun Heo <tj@kernel.org>
Fri, 19 Apr 2019 18:26:49 +0000 (11:26 -0700)
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
tools/testing/selftests/cgroup/cgroup_util.c

index 14c9fe2848062f0c2a8c37004f087d07b1d976f6..eba06f94433bd8d76a07889d2b528c9ac5a56a7c 100644 (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;
        }