diff options
-rw-r--r-- | kernel/cgroup_freezer.c | 19 |
1 files changed, 7 insertions, 12 deletions
diff --git a/kernel/cgroup_freezer.c b/kernel/cgroup_freezer.c index 5e6d26b66e88..7fa476f01d05 100644 --- a/kernel/cgroup_freezer.c +++ b/kernel/cgroup_freezer.c | |||
@@ -296,27 +296,22 @@ static int freezer_change_state(struct cgroup *cgroup, | |||
296 | int retval = 0; | 296 | int retval = 0; |
297 | 297 | ||
298 | freezer = cgroup_freezer(cgroup); | 298 | freezer = cgroup_freezer(cgroup); |
299 | |||
299 | spin_lock_irq(&freezer->lock); | 300 | spin_lock_irq(&freezer->lock); |
301 | |||
300 | update_freezer_state(cgroup, freezer); | 302 | update_freezer_state(cgroup, freezer); |
301 | if (goal_state == freezer->state) | 303 | if (goal_state == freezer->state) |
302 | goto out; | 304 | goto out; |
303 | switch (freezer->state) { | 305 | |
306 | switch (goal_state) { | ||
304 | case CGROUP_THAWED: | 307 | case CGROUP_THAWED: |
305 | retval = try_to_freeze_cgroup(cgroup, freezer); | 308 | unfreeze_cgroup(cgroup, freezer); |
306 | break; | 309 | break; |
307 | case CGROUP_FREEZING: | ||
308 | if (goal_state == CGROUP_FROZEN) { | ||
309 | /* Userspace is retrying after | ||
310 | * "/bin/echo FROZEN > freezer.state" returned -EBUSY */ | ||
311 | retval = try_to_freeze_cgroup(cgroup, freezer); | ||
312 | break; | ||
313 | } | ||
314 | /* state == FREEZING and goal_state == THAWED, so unfreeze */ | ||
315 | case CGROUP_FROZEN: | 310 | case CGROUP_FROZEN: |
316 | unfreeze_cgroup(cgroup, freezer); | 311 | retval = try_to_freeze_cgroup(cgroup, freezer); |
317 | break; | 312 | break; |
318 | default: | 313 | default: |
319 | break; | 314 | BUG(); |
320 | } | 315 | } |
321 | out: | 316 | out: |
322 | spin_unlock_irq(&freezer->lock); | 317 | spin_unlock_irq(&freezer->lock); |