From: Oren Laadan <orenl-eQaUEPhvms7ENvBUuze7eA@public.gmane.org>
To: Dan Smith <danms-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
Cc: containers-qjLDD68F18O7TbgM5vRIOg@public.gmane.org
Subject: Re: [PATCH] Don't crash if we are self-checkpointing with a child
Date: Fri, 25 Feb 2011 10:46:23 -0500 [thread overview]
Message-ID: <4D67CECF.1070608@cs.columbia.edu> (raw)
In-Reply-To: <1298402216-3786-1-git-send-email-danms-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
Thanks -- queued for v23-rc2.
Oren.
On 02/22/2011 02:16 PM, Dan Smith wrote:
> If we are doing a self-checkpoint, we will not be frozen and the
> get_freezer_task() will return NULL. If we have children, then
> may_checkpoint_task() will attempt to make sure that they are in the
> same cgroup as the freezer task, which will attempt to lock a NULL
> task pointer (and thus go boom).
>
> This patch just inserts a check before in_same_cgroup_freezer() call
> to make sure we have a freezer task. The existing check is aimed to
> determine if a task is not frozen alongside the root, so this addition
> catches the case where it is impossible.
>
> Signed-off-by: Dan Smith <danms-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
> ---
> kernel/checkpoint/checkpoint.c | 8 ++++++--
> 1 files changed, 6 insertions(+), 2 deletions(-)
>
> diff --git a/kernel/checkpoint/checkpoint.c b/kernel/checkpoint/checkpoint.c
> index 0f46acf..33f53e9 100644
> --- a/kernel/checkpoint/checkpoint.c
> +++ b/kernel/checkpoint/checkpoint.c
> @@ -262,8 +262,12 @@ static int may_checkpoint_task(struct ckpt_ctx *ctx, struct task_struct *t)
> if (t->exit_state)
> return 0;
>
> - /* verify that all tasks belongs to same freezer cgroup */
> - if (t != current && !in_same_cgroup_freezer(t, ctx->root_freezer)) {
> + /*
> + * verify that we have a freezer cgroup and that all tasks
> + * belong to the same one
> + */
> + if (t != current && (!ctx->root_freezer ||
> + !in_same_cgroup_freezer(t, ctx->root_freezer))) {
> _ckpt_err(ctx, -EBUSY, "%(T)Not frozen or wrong cgroup\n");
> return -EBUSY;
> }
prev parent reply other threads:[~2011-02-25 15:46 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-02-22 19:16 [PATCH] Don't crash if we are self-checkpointing with a child Dan Smith
[not found] ` <1298402216-3786-1-git-send-email-danms-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
2011-02-25 15:46 ` Oren Laadan [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4D67CECF.1070608@cs.columbia.edu \
--to=orenl-eqauephvms7envbuuze7ea@public.gmane.org \
--cc=containers-qjLDD68F18O7TbgM5vRIOg@public.gmane.org \
--cc=danms-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox