]> git.proxmox.com Git - mirror_lxc.git/commitdiff
cgroups: log intermediate cleanup
authorChristian Brauner <christian.brauner@ubuntu.com>
Wed, 17 Feb 2021 14:24:23 +0000 (15:24 +0100)
committerChristian Brauner <christian.brauner@ubuntu.com>
Wed, 17 Feb 2021 14:24:59 +0000 (15:24 +0100)
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
src/lxc/cgroups/cgfsng.c

index 287d17453a66509b1d8a8daba1a5db25f39f69cf..5b31fcf7654822541d8ece94aa6ac88b4f978580 100644 (file)
@@ -1142,8 +1142,13 @@ static bool cgroup_tree_create(struct cgroup_ops *ops, struct lxc_conf *conf,
                 * cgroup the container actually resides in, is below fd_limit.
                 */
                fd_final = __cgroup_tree_create(fd_limit, cgroup_leaf, 0755, cpuset_v1, false);
-               if (fd_final < 0) /* Ensure we don't leave any garbage behind. */
-                       cgroup_tree_prune(h->dfd_base, cgroup_limit_dir);
+               if (fd_final < 0) {
+                       /* Ensure we don't leave any garbage behind. */
+                       if (cgroup_tree_prune(h->dfd_base, cgroup_limit_dir))
+                               SYSWARN("Failed to destroy %d(%s)", h->dfd_base, cgroup_limit_dir);
+                       else
+                               TRACE("Removed cgroup tree %d(%s)", h->dfd_base, cgroup_limit_dir);
+               }
        } else {
                path = must_make_path(h->mountpoint, h->container_base_path, cgroup_limit_dir, NULL);