From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Serge E. Hallyn" Subject: Re: [PATCH] c/r: make ckpt_debug() safe if called by dead tasks Date: Thu, 24 Sep 2009 18:23:58 -0500 Message-ID: <20090924232358.GA9717@us.ibm.com> References: <1253826292-23452-1-git-send-email-orenl@librato.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: <1253826292-23452-1-git-send-email-orenl-RdfvBDnrOixBDgjK7y7TUQ@public.gmane.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: containers-bounces-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org Errors-To: containers-bounces-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org To: Oren Laadan Cc: containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org List-Id: containers.vger.kernel.org Quoting Oren Laadan (orenl-RdfvBDnrOixBDgjK7y7TUQ@public.gmane.org): > From: Oren Laadan > > One may not call task_pid_vnr() on dead tasks because they don't have > a valid ->nxproxy pointer. However, the ckpt_ctx cleanup may be called > by a dead task from do_exit(), in the case of zombie or "ghost" tasks. > > This patch makes ckpt_debug() safe to call from dead tasks context, so > that debug printing from code called by ckpt_ctx_free() is cool. > > Signed-off-by: Oren Laadan Acked-by: Serge Hallyn thanks, -serge > --- > include/linux/checkpoint.h | 4 +++- > 1 files changed, 3 insertions(+), 1 deletions(-) > > diff --git a/include/linux/checkpoint.h b/include/linux/checkpoint.h > index e00dd70..5294a96 100644 > --- a/include/linux/checkpoint.h > +++ b/include/linux/checkpoint.h > @@ -334,7 +334,9 @@ extern unsigned long ckpt_debug_level; > do { \ > if (ckpt_debug_level & (level)) \ > printk(KERN_DEBUG "[%d:%d:c/r:%s:%d] " fmt, \ > - current->pid, task_pid_vnr(current), \ > + current->pid, \ > + current->nsproxy ? \ > + task_pid_vnr(current) : -1, \ > __func__, __LINE__, ## args); \ > } while (0) > > -- > 1.6.0.4 > > _______________________________________________ > Containers mailing list > Containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org > https://lists.linux-foundation.org/mailman/listinfo/containers