From owner-freebsd-fs@FreeBSD.ORG Thu Feb 15 11:59:09 2007 Return-Path: X-Original-To: freebsd-fs@freebsd.org Delivered-To: freebsd-fs@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 56E8A16A406 for ; Thu, 15 Feb 2007 11:59:09 +0000 (UTC) (envelope-from tol@pdc.kth.se) Received: from mx1.kth.se (mx1.kth.se [130.237.32.140]) by mx1.freebsd.org (Postfix) with ESMTP id DA4BF13C441 for ; Thu, 15 Feb 2007 11:59:08 +0000 (UTC) (envelope-from tol@pdc.kth.se) Received: from localhost (localhost.localdomain [127.0.0.1]) by mx1.kth.se (Postfix) with ESMTP id BF1581407A8; Thu, 15 Feb 2007 12:59:07 +0100 (CET) Received: from mx1.kth.se ([127.0.0.1]) by localhost (mx1.kth.se [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 21775-01-44; Thu, 15 Feb 2007 12:59:04 +0100 (CET) Received: from kashyyyk.ite.kth.se (kashyyyk.ite.kth.se [130.237.31.35]) by mx1.kth.se (Postfix) with ESMTP id CA3CC1407EC; Thu, 15 Feb 2007 12:59:04 +0100 (CET) Received: by kashyyyk.ite.kth.se (Postfix, from userid 18404) id BD35E89CA62; Thu, 15 Feb 2007 12:59:04 +0100 (CET) Sender: tol@kashyyyk.ite.kth.se From: Tomas Olsson To: Kostik Belousov References: <6FC9F9894A9F8C49A722CF9F2132FC2204C9DAB6@ms05.mailstreet2003.net> <45D1F30A.6080403@freebsd.org> <20070213192906.U726@chrishome.localnet> <20070214162938.GA96725@keira.kiwi-computer.com> <20070214173211.L1054@chrishome.localnet> <20070214170808.GC96725@keira.kiwi-computer.com> <20070215044707.GA39168@deviant.kiev.zoral.com.ua> <20070215104537.GC39168@deviant.kiev.zoral.com.ua> Date: 15 Feb 2007 12:59:04 +0100 In-Reply-To: <20070215104537.GC39168@deviant.kiev.zoral.com.ua> Message-ID: Lines: 34 User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Virus-Scanned: by amavisd-new at kth.se Cc: freebsd-fs@freebsd.org, arla-drinkers@stacken.kth.se Subject: Re: Arla on FreeBSD X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Feb 2007 11:59:09 -0000 Kostik Belousov writes: > On Thu, Feb 15, 2007 at 11:16:00AM +0100, Tomas Olsson wrote: > > The interesting part is how we open and access the cache files, and from > > what context. arlad is in chroot() to avoid recursive lookups across /, and > > it seems like a good idea to avoid such lookups now too. > > > > So the main question is how to properly do VOP_{LOOKUP,CREATE,WRITE} etc on > > cache files in this dual context world, without mixing identities in bad > > ways or confusing the OS too much. > > > > The currently messed up code lives in > > http://cvsweb.stacken.kth.se/cvsweb.cgi/arla/nnpfs/bsd/ > > > > Most interesting is nnpfs_vnodeops-common.c (nnpfs_write_common()) and > > nnpfs_blocks.c (open_file()) > > I made really quick look at the places you mentioned. I have some > comment for open_file(). For FreeBSD >= 6.x, the right way to open vnode > from the kernel code is to use vn_open() (and then vn_close()) API. > Great! Sounds reasonable. We currently open the cache files from nnpfs' VOPs, are there any risks (deadlock?) involved if one passes an absolute path to vn_open() in such a context? I'd have liked to do use arlad's thread for this, but vput() explicitly uses curthread deep down in namei. Also, users are not normally allowed to access the cache files directly so some OSes complain on such a lookup with user creds; would that be a problem here? Of course, we wouldn't have to worry about such things if we just kept the vnode handy for each cache block file. Maybe it's a price worth paying. thanks /t