From mboxrd@z Thu Jan 1 00:00:00 1970 From: Mike Frysinger Subject: Re: [PATCH 2/2] vfs: fix d_path() for unreachable paths Date: Mon, 21 Sep 2009 11:30:41 -0400 Message-ID: <8bd0f97a0909210830j80df616m1fee64108c0125a7@mail.gmail.com> References: <20090921140220.GD14381@ZenIV.linux.org.uk> <8bd0f97a0909210710h5bb75bcdwb666b51a9155a70a@mail.gmail.com> <20090921143857.GE14381@ZenIV.linux.org.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: QUOTED-PRINTABLE Cc: Miklos Szeredi , akpm@linux-foundation.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, Valdis.Kletnieks@vt.edu, agruen@suse.de, hch@lst.de, hugh.dickins@tiscali.co.uk, matthew@wil.cx To: Al Viro Return-path: Received: from mail-yw0-f194.google.com ([209.85.211.194]:37528 "EHLO mail-yw0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755198AbZIUPa5 convert rfc822-to-8bit (ORCPT ); Mon, 21 Sep 2009 11:30:57 -0400 In-Reply-To: <20090921143857.GE14381@ZenIV.linux.org.uk> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On Mon, Sep 21, 2009 at 10:38, Al Viro wrote: > On Mon, Sep 21, 2009 at 10:10:17AM -0400, Mike Frysinger wrote: >> it works without having to copy & paste the same exact structures ov= er >> and over. =C2=A0a suggestion as how to do it cleanly without bloatin= g the >> code is certainly welcome. =C2=A0it doesnt really matter that it's o= n the >> stack as the usage is small and d_path() is given the size of the >> buffer, so it isnt going to overflow. > > Umm... =C2=A0Surely, you can put a CPU number + one bit into PDE->dat= a? =C2=A0As in > =C2=A0 =C2=A0 =C2=A0 =C2=A0proc_create_data("icplb", ....., (void *)(= cpu * 2)) > =C2=A0 =C2=A0 =C2=A0 =C2=A0proc_create_data("dcplb", ....., (void *)(= cpu * 2 + 1)) > and > =C2=A0 =C2=A0 =C2=A0 =C2=A0struct proc_dir_entry *pde =3D PDE(file->f= _path.dentry->d_inode); > =C2=A0 =C2=A0 =C2=A0 =C2=A0unsigned long n =3D (unsigned long) pde->d= ata; > =C2=A0 =C2=A0 =C2=A0 =C2=A0... > =C2=A0 =C2=A0 =C2=A0 =C2=A0cpu =3D n / 2; > =C2=A0 =C2=A0 =C2=A0 =C2=A0is_D =3D n & 1; if i'd known this route, i'd have used it ;). i'll look into changing it, thanks. >> > ??For another... locking in that loop >> > over processes and VMAs of each looks very suspicios, while we are= at it. >> >> we've reviewed it several times and exercised it in multiple ways. =C2= =A0so >> unless you have a real idea of something being wrong, the code has >> been vetted heavily. > > write_lock_irq tasklist_lock > loop over processes > =C2=A0 =C2=A0 =C2=A0 =C2=A0get_task_mm [now VM is pinned down, but no= t locked] > =C2=A0 =C2=A0 =C2=A0 =C2=A0walk the VMA list without any locking > > Something on another CPU (you have SMP systems, judging by the previo= usly > discussed code, right?) does munmap(). the SMP port is limited due to lack of hardware cache coherency, but we'll check out this call path -mike -- To unsubscribe from this list: send the line "unsubscribe linux-fsdevel= " in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html