[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20110829160031.GB8392@redhat.com>
Date: Mon, 29 Aug 2011 18:00:31 +0200
From: Oleg Nesterov <oleg@...hat.com>
To: Tejun Heo <tj@...nel.org>
Cc: "Rafael J. Wysocki" <rjw@...k.pl>,
Paul Menage <paul@...lmenage.org>,
containers@...ts.linux-foundation.org,
linux-pm@...ts.linux-foundation.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH pm-freezer 1/4] cgroup_freezer: fix freezer->state
setting bug in freezer_change_state()
On 08/29, Tejun Heo wrote:
>
> --- work.orig/kernel/cgroup_freezer.c
> +++ work/kernel/cgroup_freezer.c
> @@ -311,14 +311,14 @@ static int freezer_change_state(struct c
> if (goal_state == freezer->state)
> goto out;
>
> - freezer->state = goal_state;
> -
> switch (goal_state) {
> case CGROUP_THAWED:
> + freezer->state = CGROUP_THAWED;
> atomic_dec(&system_freezing_cnt);
> unfreeze_cgroup(cgroup, freezer);
> break;
> case CGROUP_FROZEN:
> + freezer->state = CGROUP_FREEZING;
At first glance, this is correct. I'll try to recheck.
But,
> atomic_inc(&system_freezing_cnt);
iiuc this becomes wrong... Suppose a user writes "FROZEN" twice,
before freezer->state becomes CGROUP_FROZEN.
I think we should actually fix the "goal_state == freezer->state"
check above.
Oleg.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists