From mboxrd@z Thu Jan 1 00:00:00 1970 From: Li Zefan Subject: Re: + cgroups-fix-pid-namespace-bug.patch added to -mm tree Date: Fri, 24 Jul 2009 13:26:53 +0800 Message-ID: <4A69461D.6080201@cn.fujitsu.com> References: <200907022320.n62NKpKO022860@imap1.linux-foundation.org> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <200907022320.n62NKpKO022860-AB4EexQrvXRQetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@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: akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@public.gmane.org Cc: "containers-qjLDD68F18O7TbgM5vRIOg@public.gmane.org" , Benjamin Blum , Paul Menage List-Id: containers.vger.kernel.org > Subject: cgroups: fix pid namespace bug > From: Li Zefan > Hi Andrew, Could you queue this fix for .31. I think there's no more objection to this patch or to queuing it for .31 instead of .32. And then Benjamin can rebase his patchset on top of it. > The bug was introduced by commit cc31edceee04a7b87f2be48f9489ebb72d264844 > ("cgroups: convert tasks file to use a seq_file with shared pid array"). > > We cache a pid array for all threads that are opening the same "tasks" > file, but the pids in the array are always from the namespace of the > last process that opened the file, so all other threads will read pids > from that namespace instead of their own namespaces. > > To fix it, we maintain a list of pid arrays, which is keyed by pid_ns. > The list will be of length 1 at most time. > > Reported-by: Paul Menage > Idea-by: Paul Menage > Signed-off-by: Li Zefan > Reviewed-by: Serge Hallyn > Cc: Balbir Singh > Signed-off-by: Andrew Morton > ---