[PATCH] do not stat autofs mounts(was Re: hall and autofs)

John (J5) Palmieri johnp at redhat.com
Wed May 17 13:05:04 PDT 2006


I see, in /proc/mount will autofs mounted directories always come after
the actual autofs mount point?  If so it is a trivial fix involving a
hash.  If not we would have to do it in two passes over /proc/mount
which could be problematic.  

On Wed, 2006-05-17 at 21:50 +0200, Stefan Seyfried wrote:
> On Wed, May 17, 2006 at 02:59:34PM -0400, John (J5) Palmieri wrote:
> > Here is a patch to ignore autofs mounts when stating.  I basically just
> > added a || strcmp (fstype, "autofs") == 0 to the nfs patch.  It is built
> > in Fedora Rawhide and seems to work.
> 
> Well, it does not hurt, but it will for sure not help.
> Accessing an autofs mount point does - nothing.
> Accessing the directory _below_ the autofs mount point triggers the mount or
> renews the timeout.
> The directory below the mount point has the fs type of its filesystem.
> 
> Do this to test:
> /etc/auto.master:
> ####################################
> /test	/etc/auto.test
> ############################
> /etc/auto.test:
> cd	-fstype=auto	:/dev/hdc
> # use your CD device
> 
> now start the automounter, access /test/cd (with a cd in the drive).
> /proc/mounts:
> automount(pid30397) /test autofs rw 0 0
> /dev/hdc /test/cd iso9660 ro 0 0
> 
> if you now stat /test/cd from HAL every few seconds, it will never expire.
> 
> To fix this, you need to collect a list of all autofs mountpoints and skip
> everything below them.
> 
> > +		 * If this is an autofs mount (fstype == 'autofs') ignore the mount. Reason:
> > +		 *  1. stats on mounts managed by autofs will cause the mount
> > +		 *     point to be remounted during an unmount
> 
> well, but you do not catch the mount point with this check...
> 
> > -		if (strcmp(mnt.mnt_type, "nfs") == 0)
> > +		if (strcmp(mnt.mnt_type, "nfs") == 0 ||
> > +		    strcmp(mnt.mnt_type, "autofs") == 0)
> >  			continue;
> 
> does not hurt, but i'd bet that it also does not help. ;-)
-- 



More information about the hal mailing list