diff --git a/criu/seize.c b/criu/seize.c index edeb57cc8a..b8e070c00e 100644 --- a/criu/seize.c +++ b/criu/seize.c @@ -509,6 +509,7 @@ static int check_freezer_cgroup(void) { enum freezer_state state = THAWED; int fd; + int exit_code = -1; BUG_ON(!freeze_cgroup_disabled); @@ -517,17 +518,22 @@ static int check_freezer_cgroup(void) return -1; state = get_freezer_state(fd); - close(fd); if (state == FREEZER_ERROR) { - return -1; + goto err; } + origin_freezer_state = state == FREEZING ? FROZEN : state; + if (state != THAWED) { - pr_err("One or more plugins are incompatible with the freezer cgroup in the FROZEN state.\n"); - return -1; + pr_warn("unfreezing cgroup for plugin compatibility\n"); + if (freezer_write_state(fd, THAWED)) + goto err; } - return 0; + exit_code = 0; +err: + close(fd); + return exit_code; } static int freeze_processes(void)