Linux Container Development
 help / color / mirror / Atom feed
From: Oren Laadan <orenl-eQaUEPhvms7ENvBUuze7eA@public.gmane.org>
To: Sukadev Bhattiprolu
	<sukadev-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org>
Cc: Containers <containers-qjLDD68F18O7TbgM5vRIOg@public.gmane.org>
Subject: Re: [PATCH] Reset pos in cr_write_pids()
Date: Fri, 23 Jan 2009 18:08:10 -0500	[thread overview]
Message-ID: <497A4DDA.4080408@cs.columbia.edu> (raw)
In-Reply-To: <20090122051407.GA20039-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>


Sukadev Bhattiprolu wrote:
> Noticed this while reviewing the code in [v12] branch of your git tree.

Thanks. Will fix.

Oren.

> 
> ---
> From: Sukadev Bhattiprolu <suka@sukaT61.(none)>
> Date: Wed, 21 Jan 2009 21:10:34 -0800
> Subject: [PATCH] Reset pos in cr_write_pids()
> 
> If the number of tasks exceed CR_HDR_PIDS_CHUNK, pos must be reset
> for a second iteration in the outer loop.
> ---
>  checkpoint/checkpoint.c |    3 ++-
>  1 files changed, 2 insertions(+), 1 deletions(-)
> 
> diff --git a/checkpoint/checkpoint.c b/checkpoint/checkpoint.c
> index fbcd9eb..3136850 100644
> --- a/checkpoint/checkpoint.c
> +++ b/checkpoint/checkpoint.c
> @@ -297,7 +297,7 @@ static int cr_write_pids(struct cr_ctx *ctx)
>  	struct pid_namespace *ns;
>  	struct task_struct *task;
>  	struct task_struct **tasks_arr;
> -	int tasks_nr, n, ret = 0, pos = 0;
> +	int tasks_nr, n, ret = 0, pos;
>  
>  	ns = ctx->root_nsproxy->pid_ns;
>  	tasks_arr = ctx->tasks_arr;
> @@ -306,6 +306,7 @@ static int cr_write_pids(struct cr_ctx *ctx)
>  	hh = cr_hbuf_get(ctx, sizeof(*hh) * CR_HDR_PIDS_CHUNK);
>  
>  	while (tasks_nr > 0) {
> +		pos = 0;
>  		rcu_read_lock();
>  		for (n = min(tasks_nr, CR_HDR_PIDS_CHUNK); n; n--) {
>  			task = tasks_arr[pos];

      parent reply	other threads:[~2009-01-23 23:08 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-01-22  5:14 [PATCH] Reset pos in cr_write_pids() Sukadev Bhattiprolu
     [not found] ` <20090122051407.GA20039-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
2009-01-22  5:19   ` Sukadev Bhattiprolu
2009-01-23 23:08   ` 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=497A4DDA.4080408@cs.columbia.edu \
    --to=orenl-eqauephvms7envbuuze7ea@public.gmane.org \
    --cc=containers-qjLDD68F18O7TbgM5vRIOg@public.gmane.org \
    --cc=sukadev-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@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