From mboxrd@z Thu Jan 1 00:00:00 1970 From: Mike Waychison Subject: Re: [RFC][PATCH 1/8] namespace: use global namespace semaphore Date: Fri, 03 Jun 2005 10:26:06 -0700 Message-ID: <42A092AE.6080704@waychison.com> References: <429BD8B7.7070906@waychison.com> <429C88F9.6010200@waychison.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: Miklos Szeredi , linux-fsdevel@vger.kernel.org, jamie@shareable.org, viro@parcelfarce.linux.theplanet.co.uk Return-path: Received: from 216-239-45-4.google.com ([216.239.45.4]:31718 "EHLO 216-239-45-4.google.com") by vger.kernel.org with ESMTP id S261410AbVFCR0y (ORCPT ); Fri, 3 Jun 2005 13:26:54 -0400 To: Ian Kent In-Reply-To: Sender: linux-fsdevel-owner@vger.kernel.org List-Id: linux-fsdevel.vger.kernel.org Ian Kent wrote: > On Tue, 31 May 2005, Miklos Szeredi wrote: > > >>>namespace->sem did indeed surround the mounting and unmounting >>>processes, however it never was meant to protect the integrety of the >>>vfsmount tree, only namespace->list. >> >>I'm not sure about that. The copy_tree() function relies on the tree >>not chaning underneeth, and that's why it's called with >>namespace->sem. And vfsmount_lock can't be used, because copy_tree() >>can sleep on allocations. >> >> >>>>Maybe lookup_mnt shouldn't be static and should be exported instead? >>>> >>> >>>lookup_mnt is the wrong operation, as it looks for a mountpoint given a >>>vfsmount and dentry. What you need is a way to walk the tree, and I'm >>>inclined to say that something like next_mnt is what you are looking for. >> >>Can someone explain, why autofs needs to walk the mount tree? > > > I generally don't need to walk the vfsmount tree except during expire (ref > may_umount_tree in namespace.c). What I find is that I often need to > locate a sibling vfsmount given a parent and a dentry (aka. lookup_mnt). > This is because, after a mount is triggered (the daemon is notified and > does the mount) I need it in order to follow it. I expect Mike has similar > needs. > I handle this in the vfs layer due to it's hairyness and the fact that other filesystems may want to use it (samba, afs, autofs4, basically anything that wants to automount things from kernelspace). Mike Waychison