From: Al Viro Subject: Re: v9fs writepage Date: Sat, 30 Apr 2005 19:36:53 +0100 Message-ID: <20050430183653.GE13052@parcelfarce.linux.theplanet.co.uk> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Miklos Szeredi , v9fs-developer@lists.sourceforge.net, kernel-mentors@selenic.com, linux-fsdevel@vger.kernel.org, hch@infradead.org Return-path: Received: from parcelfarce.linux.theplanet.co.uk ([195.92.249.252]:9926 "EHLO parcelfarce.linux.theplanet.co.uk") by vger.kernel.org with ESMTP id S261334AbVD3Sgb (ORCPT ); Sat, 30 Apr 2005 14:36:31 -0400 To: Eric Van Hensbergen Content-Disposition: inline In-Reply-To: Sender: linux-fsdevel-owner@vger.kernel.org List-Id: linux-fsdevel.vger.kernel.org On Sat, Apr 30, 2005 at 01:10:39PM -0500, Eric Van Hensbergen wrote: > It would seem a relaxed check in my v9fs_fid_locate would provide the > same service as keeping open files in the inode. We had looked at > doing something similar, but I hated the idea of having to keep the > extra book-keeping if there was another path (particularly since we > are already cacheing fids in dentries). a) 9P server is entirely within its rights to serve different contents depending on the implied uid and even on phase of moon during the processing of auth. So client-side file contents cache is not kosher. b) 9P server is allowed (and often *does*, for RPC-style applications) to serve absolutely different contents for IO on different open() on the same file by the same user. c) caches belong to server side in that model. Server knows whether it's allowed to cache given file; client does not and I don't see any provisions for transfer of that information in the protocol. FWIW, I would expect something like kernel-side caching fs that would be explicitly told to cache given tree. Keep in mind that 9P closely matches the Plan 9 VFS API, but it's not the same thing. Kernel makes direct calls into filesystem; it's just that mnt happens to map them onto 9P exchanges. Natural place for client-side cache would be between VFS and mnt, very likely as a separate fs driver. FWIW, I would suggest the folks involved in that fun to take a good look at http://cm.bell-labs.com/magic/man2html/2/auth and around it. Especially when it comes to recreating namespaces, etc. Putting the information about caching into 9P would be interesting, but that doesn't belong here - such stuff should be taken to Plan 9 maillist.