From mboxrd@z Thu Jan 1 00:00:00 1970 From: "William H. Taber" Subject: Re: [autofs] [RFC PATCH]autofs4: hang and proposed fix Date: Wed, 23 Nov 2005 13:47:02 -0500 Message-ID: <4384B926.5030104@us.ibm.com> References: <20051116101740.GA9551@RAM> <1132159817.5720.33.camel@localhost> <1132192362.5720.163.camel@localhost> <437CD7D2.40003@us.ibm.com> <437DF12A.5050805@us.ibm.com> <437E0B62.4000306@us.ibm.com> <1132340265.5720.191.camel@localhost> <437E34D9.4050102@us.ibm.com> <4381F873.2010408@us.ibm.com> <438359FA.4060105@us.ibm.com> <43849C11.6000302@us.ibm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Cc: Ram Pai , autofs mailing list , linux-fsdevel Return-path: Received: from e31.co.us.ibm.com ([32.97.110.149]:5078 "EHLO e31.co.us.ibm.com") by vger.kernel.org with ESMTP id S932177AbVKWSrF (ORCPT ); Wed, 23 Nov 2005 13:47:05 -0500 Received: from westrelay02.boulder.ibm.com (westrelay02.boulder.ibm.com [9.17.195.11]) by e31.co.us.ibm.com (8.12.11/8.12.11) with ESMTP id jANIl4ND009401 for ; Wed, 23 Nov 2005 13:47:04 -0500 Received: from d03av01.boulder.ibm.com (d03av01.boulder.ibm.com [9.17.195.167]) by westrelay02.boulder.ibm.com (8.12.10/NCO/VERS6.8) with ESMTP id jANIkfeq067176 for ; Wed, 23 Nov 2005 11:46:41 -0700 Received: from d03av01.boulder.ibm.com (loopback [127.0.0.1]) by d03av01.boulder.ibm.com (8.12.11/8.13.3) with ESMTP id jANIl3oc012991 for ; Wed, 23 Nov 2005 11:47:04 -0700 To: Ian Kent In-Reply-To: Sender: linux-fsdevel-owner@vger.kernel.org List-Id: linux-fsdevel.vger.kernel.org Ian Kent wrote: >>I am a little unclear about this. Which directory are you talking about? The >>mount-over directory or the directory being mounted? My picture of things >>(and I haven't verified this by doing anything mundane like reading the code) >>is that There is a directory (such as /net ) which is of type autofs and as >>needed new directories of type autofs are created under it for the various >>hosts/filenames. Over these subdirectories (the mount-over directories) get >>mounted the remote filesystems, usually of type NFS. Is this a correct >>understanding? > > > Yep. That's an indirect mount. OK. Got it. > > The directories I'm refering to are the ones created inside the autofs > mount point /net or other autofs mount point. Creating the directories > makes them browsable without necessarily mounting them (as long as the > module knows when to trigger a mount request). This lazyness is what > causes all the fus. > > >>>Case 2 needs special attention. To achieve this I would need to have two >>>types of unhashed dentry, valid and invalid (perhaps because of a ENOENT >>>return from the daemon on mount). >>> >> >>If my understanding above is correct, I don't think you need to hide the >>dentry for the autofs mount-over directory. If there is an active mount, then >>the dentries d_mounted flag will be set and the normal mountpoint traversal >>will work. If nothing is mounted here then the autofs mount-over directory >>lookup functions will be called. This is where the actual mount request gets >>triggered. The dentry created here should not be added to the dentry cache >>until the dentry is actually ready to use. It has to be kept in a way that >>can be found by subsequent calls to lookup in case there are multiple requests >>for it. The trick is that the first lookup to succeed has to be the one for >>the mount request. But once it is on the dentry hash chain, revalidate has to >>be careful because if the revalidate fails then the dentry will be >>invalidated. And if revalidate succeeds then everything needs to be setup so >>that folow_down will work. Hmm. I will have to think about this some more. > > > That was how things used to work but late mounting is what's needed to > provide the function expected of an automounter when people start using > this in an enterprise environment. Basically autofs tells lies until it's > forced to tell the truth. > > Point is people expect to be able to see the mount points without causing > them to mount until they actually try and access something inside the > mount. > > Hence "browseable". > OK. This is a whole other kettle of fish. This means that readdir lies and reports about the existance of directories but doesn't mount them until someone is actually foolish enough to include them in a pathname. That's the problem. Too many fools. :^) And thanks for the pointer to the paper. Will