From owner-freebsd-current Tue Oct 21 19:03:38 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.7/8.8.7) id TAA26062 for current-outgoing; Tue, 21 Oct 1997 19:03:38 -0700 (PDT) (envelope-from owner-freebsd-current) Received: from smtp03.primenet.com (smtp03.primenet.com [206.165.5.84]) by hub.freebsd.org (8.8.7/8.8.7) with ESMTP id TAA26038 for ; Tue, 21 Oct 1997 19:03:30 -0700 (PDT) (envelope-from tlambert@usr03.primenet.com) Received: (from daemon@localhost) by smtp03.primenet.com (8.8.7/8.8.7) id TAA25405; Tue, 21 Oct 1997 19:03:17 -0700 (MST) Received: from usr03.primenet.com(206.165.6.203) via SMTP by smtp03.primenet.com, id smtpd025388; Tue Oct 21 19:03:10 1997 Received: (from tlambert@localhost) by usr03.primenet.com (8.8.5/8.8.5) id TAA09608; Tue, 21 Oct 1997 19:03:11 -0700 (MST) From: Terry Lambert Message-Id: <199710220203.TAA09608@usr03.primenet.com> Subject: Re: nullfs & current UPDATE! To: roberto@keltia.freenix.fr (Ollivier Robert) Date: Wed, 22 Oct 1997 02:03:10 +0000 (GMT) Cc: current@FreeBSD.ORG In-Reply-To: <19971021203807.51847@keltia.freenix.fr> from "Ollivier Robert" at Oct 21, 97 08:38:07 pm X-Mailer: ELM [version 2.4 PL23] Content-Type: text Sender: owner-freebsd-current@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk > > Whatever needs to be done should probably be done in null_inactive(), > > look at sys/ufs/ufs/ufs_inode.c:ufs_inactive(). > > By using the following patch, I've been able to create and delete hundreds > of files in a nullfs mounted directory. No vnode leak as far as I can see > from the sysctl debug.numvnodes. fsck reports no missing blocks. No panic, > just works. Now that seems too easy :-) > > I know there is a comment in null_inactive() about doing nothing in there > but it seemed logical to inform the lower layer... > > PS: a similar problem is in umapfs which is based on nullfs. > > Opinions about this ? Using this approach sort of breaks the ability to collapse out intermediate vnode layers, since it leaves things associated with the upper level vnodes that probably ought not to be left associated. Specifically, if you look back to John's comment about vnode_pager_uncache, and then look at nullfs... Probably the "correct" way to handle this is to avoid aliases, and instead establish a null_getpage/null_putpage VOP for page access, and force it to make the reference to the underlying FS. This is actually a lot cleaner than implementing vp dereferencing ops, since it would allow you to pass the vp to the underlying FS back up in place of the vp for the covering fs. When you could do this really depends on if it's file ops, directory ops, or whatever. For example, if an open returns an alias node, then the alias dereference needs to take place on anything which could reference it. But this does not necessarily mean both files and directories would be affected. One could easily envision a UID FS that only operated on files... The main problem is the page references, and the need for the vnode pager to be able to identify the pages referenced by the underlying vnode and those referenced by the upper level vnode, but which came from the lower level vnode. Similarly, you could envision a name space extension for resource forks which would stack and have file references turn into directories, and the actual file contents go into the "default" for defined as "name/data" instead of "name". Such an extension would return the underlying vnode for the "data" for, but an alias vnode for non-"data" fork. Really, I'd like to see per FS page routines, and things like the per fs inactive left actually NULL, where possible. Terry Lambert terry@lambert.org --- Any opinions in this posting are my own and not those of my present or previous employers.